Binary search code in java