CheckpointAndChangeQueue q = new CheckpointAndChangeQueue(changeSource,
persistDir, internalFactory, clientFactory);
q.setMaximumQueueSize(2);
q.start(null);
String checkpoint = null;
checkpoint = checkChangesAndReturnLastCheckpoint(q.resume(checkpoint), 0, 2);
// We call q.resume but do not set checkpoint forward to reflect the
// changes from the batch.
checkChangesAndReturnLastCheckpoint(q.resume(checkpoint), 2, 2);
// Since we have not advanced checkpoint we replay the batch.
checkpoint = checkChangesAndReturnLastCheckpoint(q.resume(checkpoint), 2, 2);