Hello, I would like to do the following in Java: I have an element, and I would like to know what would be its index had it been inserted into a collection of other objects (given they're already sorted).
So if I have a vector of ints like this: 1,3,5,7,9 and I had the int '2' in hand, I'd know that its 'would-be' index is i=1, between values 1 and 3.