BinarySearchIterator { public void higher() { low = mid + 1; } BinarySearchIterator(int low, int high);  BinarySearchIterator(); int next(); void lower(); void higher(); boolean hasNext(); void reset(int high, int low);  }
@Test void testHigher() { BinarySearchIterator iterator = new BinarySearchIterator(0, 15); int mid = -1; while(iterator.hasNext()) { int next = iterator.next(); assertTrue(next > mid); mid = next; iterator.higher(); } assertEquals(15, mid); }