JsonIterator implements Iterator<JsonObject> { @Override public void remove() { throw new UnsupportedOperationException(this.getClass().getName() + ".remove") ; } JsonIterator(QueryIterator queryIterator, List<String> resultVars); @Override boolean hasNext(); @Override JsonObject next(); @Override void remove();  }
@Test(expected = UnsupportedOperationException.class) public void testRemoveNotImplemented() { JsonIterator iterator = new JsonIterator(null, Collections.emptyList()); iterator.remove(); }