question: public static int binarySearchFloor ( long [ ] a , long key , boolean inclusive , boolean stayInBounds ) { int index = Arrays . binarySearch ( a , key ) ; index = index < 0 ? - ( index + 2 ) : ( inclusive ? index : ( index - 1 ) ) ; return stayInBounds ? Math . max ( 0 , index ) : index ; }
target:  Returns the index of the largest value in an array that is less than (or optionally equal to) a specified key. <p> The search is performed using a binary search algorithm, and so the array must be sorted.