NestedIterator implements Iterator<T> { @Override public void remove() { throw new UnsupportedOperationException(); } NestedIterator(Iterable<? extends Iterable<T>> iterableOfIterables); @Override boolean hasNext(); @Override T next(); @Override void remove();  }
@Test(expected = UnsupportedOperationException.class) public void removeNotSupported() { NestedIterator<String> nestedIterator = new NestedIterator<>( Collections.singletonList(Collections.singletonList("Test"))); nestedIterator.remove(); }