SequentialSpillableIdentifierGenerator implements SpillableIdentifierGenerator { @Override public byte[] next() { Preconditions.checkState(!done); nextCalled = true; byte nextIndentifier = currentIdentifier; seek(); return new byte[]{nextIndentifier}; }  @Override byte[] next(); @Override void register(byte[] identifierArray);  }
@Test public void simpleSequentialIdGenerationTest() { SequentialSpillableIdentifierGenerator gen = new SequentialSpillableIdentifierGenerator(); for (int index = 0; index < (((int)Byte.MAX_VALUE) + 1); index++) { byte[] id = gen.next(); checkId(index, id); } boolean threwException = false; try { gen.next(); } catch (Exception e) { threwException = true; } Assert.assertTrue(threwException); }