private void close() {
    try {
      iterator.close();
      isClosed = true;
    } catch (IOException e) {
      throw new UncheckedIOException(e);
    }
  }
@Test
  public void testCloseCalledOnceForMultipleHasNextCalls() throws Exception {
    CloseableIterator<String> underlying = mock(CloseableIterator.class);
    ClosingIterator<String> closingIterator = new ClosingIterator<>(underlying);
    assertThat(closingIterator).isExhausted();
    verify(underlying, times(1)).close();
  }