IdentityRecordNumbers implements RecordNumbers { @NotNull @Override public Iterator<Entry> iterator() { throw new UnsupportedOperationException("invalid usage of the record-number-to-offset table"); }  @Override int getOffset(int recordNumber); @NotNull @Override Iterator<Entry> iterator();  }
@Test(expected = UnsupportedOperationException.class) public void iteratorShouldBeInvalid() { new IdentityRecordNumbers().iterator(); }