Upper Bound Using Binary Search Code In Java