IllegalSegmentReferences implements SegmentReferences { @NotNull @Override public Iterator<SegmentId> iterator() { throw new IllegalStateException("invalid use"); }  @Override SegmentId getSegmentId(int reference); @NotNull @Override Iterator<SegmentId> iterator();  }
@Test(expected = IllegalStateException.class) public void iteratorShouldBeIllegal() throws Exception { new IllegalSegmentReferences().iterator(); }