RangeIteratorFacade implements RangeIterator { @Override public final long getSize() { return delegate.getSize(); } 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 testGetSize() { RangeIterator delegate = mock(RangeIterator.class); RangeIteratorFacade<RangeIterator> facade = getFacade(delegate); final long size = 5L; when(delegate.getSize()).thenReturn(size); assertEquals("should be equal", size, facade.getSize()); }