RangeIteratorFacade implements RangeIterator { @Override public final void skip(long skipNum) { delegate.skip(skipNum); } RangeIteratorFacade(final @NotNull R delegate); @Override final void skip(long skipNum); @Override final long getSize(); @Override final long getPosition(); @Override final boolean hasNext(); @Override Object next();  }
@Test public void testSkip() { RangeIterator delegate = mock(RangeIterator.class); RangeIteratorFacade<RangeIterator> facade = getFacade(delegate); CompletableFuture<Long> latch = new CompletableFuture<>(); doAnswer(invoked -> latch.complete(invoked.getArgument(0))).when(delegate).skip(anyLong()); final long expected = 7L; assertFalse("should not be done", latch.isDone()); facade.skip(expected); assertEquals("should be equal", (Long) expected, latch.getNow(-1L)); }