### Question:
PortIterator implements Iterator<Integer> { @Override public void remove() { throw new UnsupportedOperationException(); } PortIterator( int[] portRanges ); @Override boolean hasNext(); @Override Integer next(); @Override void remove();  }### Answer:
@Test public void shouldNotSupportRemove() { try { new PortIterator( new int[]{6000, 6005} ).remove(); fail("Should have thrown exception"); } catch ( UnsupportedOperationException e ) { } }