@Test(expected = UnsupportedOperationException.class) public void testNextThrows() { RangeIterator delegate = mock(RangeIterator.class); RangeIteratorFacade<RangeIterator> facade = getFacade(delegate); doThrow(new IllegalArgumentException("base facade class illegally called delegate next() method")).when(delegate).next(); facade.next(); }
@Override public Object next() { throw new UnsupportedOperationException("override this method to ensure delegate elements are wrapped appropriately with facades."); }
RangeIteratorFacade implements RangeIterator { @Override public Object next() { throw new UnsupportedOperationException("override this method to ensure delegate elements are wrapped appropriately with facades."); } }
RangeIteratorFacade implements RangeIterator { @Override public Object next() { throw new UnsupportedOperationException("override this method to ensure delegate elements are wrapped appropriately with facades."); } RangeIteratorFacade(final @NotNull R delegate); }
RangeIteratorFacade implements RangeIterator { @Override public Object next() { throw new UnsupportedOperationException("override this method to ensure delegate elements are wrapped appropriately with facades."); } 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(); }
RangeIteratorFacade implements RangeIterator { @Override public Object next() { throw new UnsupportedOperationException("override this method to ensure delegate elements are wrapped appropriately with facades."); } 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();  }