@Test(expected = NoSuchElementException.class) public void shouldThrowNoSuchElementOnPeekNextKeyIfNoNext() throws Exception { iterator = new SegmentIterator(Arrays.asList(segmentOne, segmentTwo).iterator(), hasNextCondition, Bytes.wrap("f".getBytes()), Bytes.wrap("h".getBytes())); iterator.peekNextKey(); }
@Override public Bytes peekNextKey() { if (!hasNext()) { throw new NoSuchElementException(); } return currentIterator.peekNextKey(); }
SegmentIterator implements KeyValueIterator<Bytes, byte[]> { @Override public Bytes peekNextKey() { if (!hasNext()) { throw new NoSuchElementException(); } return currentIterator.peekNextKey(); } }
SegmentIterator implements KeyValueIterator<Bytes, byte[]> { @Override public Bytes peekNextKey() { if (!hasNext()) { throw new NoSuchElementException(); } return currentIterator.peekNextKey(); } SegmentIterator(final Iterator<Segment> segments,
                    final HasNextCondition hasNextCondition,
                    final Bytes from,
                    final Bytes to); }
SegmentIterator implements KeyValueIterator<Bytes, byte[]> { @Override public Bytes peekNextKey() { if (!hasNext()) { throw new NoSuchElementException(); } return currentIterator.peekNextKey(); } SegmentIterator(final Iterator<Segment> segments,
                    final HasNextCondition hasNextCondition,
                    final Bytes from,
                    final Bytes to); void close(); @Override Bytes peekNextKey(); @Override boolean hasNext(); KeyValue<Bytes, byte[]> next(); void remove(); }
SegmentIterator implements KeyValueIterator<Bytes, byte[]> { @Override public Bytes peekNextKey() { if (!hasNext()) { throw new NoSuchElementException(); } return currentIterator.peekNextKey(); } SegmentIterator(final Iterator<Segment> segments,
                    final HasNextCondition hasNextCondition,
                    final Bytes from,
                    final Bytes to); void close(); @Override Bytes peekNextKey(); @Override boolean hasNext(); KeyValue<Bytes, byte[]> next(); void remove();  }