MockChangeSource.newChange(1), null,
MockChangeSource.newChange(2), null, null,
MockChangeSource.newChange(3),
MockChangeSource.newChange(4));
ChangeSource changeSource = new MockChangeSource(changes);
CheckpointAndChangeQueue q = new CheckpointAndChangeQueue(changeSource,
persistDir, internalFactory, clientFactory);
q.setMaximumQueueSize(5);
q.start(null);
String checkpoint = null;
checkpoint = checkChangesAndReturnLastCheckpoint(q.resume(checkpoint), 0, 2);
checkpoint = checkChangesAndReturnLastCheckpoint(q.resume(checkpoint), 2, 1);
Iterator<CheckpointAndChange> it = q.resume(checkpoint).iterator();
assertFalse(it.hasNext());
checkpoint = checkChangesAndReturnLastCheckpoint(q.resume(checkpoint), 3, 2);
it = q.resume(checkpoint).iterator();
assertFalse(it.hasNext());
}