### Question:
DelegatingPeekingKeyValueIterator implements KeyValueIterator<K, V>, PeekingKeyValueIterator<K, V> { @Override public synchronized K peekNextKey() { if (!hasNext()) { throw new NoSuchElementException(); } return next.key; } DelegatingPeekingKeyValueIterator(final String storeName, final KeyValueIterator<K, V> underlying); @Override synchronized K peekNextKey(); @Override synchronized void close(); @Override synchronized boolean hasNext(); @Override synchronized KeyValue<K, V> next(); @Override void remove(); @Override KeyValue<K, V> peekNext();  }### Answer:
@Test(expected = NoSuchElementException.class) public void shouldThrowNoSuchElementWhenNoMoreItemsLeftAndPeekNextCalled() throws Exception { final DelegatingPeekingKeyValueIterator<String, String> peekingIterator = new DelegatingPeekingKeyValueIterator<>(name, store.all()); peekingIterator.peekNextKey(); }