BinarySearch completed with test cases