question: protected int findInsertIndex ( double value ) { if ( values . size ( ) > 2 ) { int startIndex = values . size ( ) > > 1 ; double startValue = values . get ( startIndex ) ; int insertAt ; if ( value < startValue ) { insertAt = findInsertIndex ( 0 , startIndex - 1 , value ) ; } else if ( value > startValue ) { insertAt = findInsertIndex ( startIndex + 1 , values . size ( ) - 1 , value ) ; } else { insertAt = startIndex ; } if ( insertAt == values . size ( ) ) { return - 1 ; } return insertAt ; } if ( values . size ( ) == 2 ) { if ( value > values . get ( 1 ) ) { return - 1 ; } else if ( value <= values . get ( 0 ) ) { return 0 ; } else { return 1 ; } } if ( values . size ( ) == 1 ) { if ( value > values . get ( 0 ) ) { return - 1 ; } else { return 0 ; } } return - 1 ; }
target:  Returns the index into which to insert to. Proptected access level for convenient testing.