PixExMeasurementReader implements Iterator<Measurement>, Closeable { @Override public void remove() { throw new UnsupportedOperationException(); } PixExMeasurementReader(File inputDir); @Override boolean hasNext(); @Override Measurement next(); @Override void remove(); @Override void close();  }
@Test(expected = UnsupportedOperationException.class) public void testRemoveThrowsException() { final PixExMeasurementReader reader = new PixExMeasurementReader(inputDir); reader.remove(); }