@Test
public void testCreateSnapshot() throws Exception {

	CheckpointStatsCounts counts = new CheckpointStatsCounts();
	counts.incrementRestoredCheckpoints();
	counts.incrementRestoredCheckpoints();
	counts.incrementRestoredCheckpoints();
	counts.incrementInProgressCheckpoints();
	counts.incrementCompletedCheckpoints();
	counts.incrementInProgressCheckpoints();
	counts.incrementCompletedCheckpoints();
	counts.incrementInProgressCheckpoints();
	counts.incrementCompletedCheckpoints();
	counts.incrementInProgressCheckpoints();
	counts.incrementCompletedCheckpoints();
	counts.incrementInProgressCheckpoints();
	counts.incrementFailedCheckpoints();
	long restored = counts.getNumberOfRestoredCheckpoints();
	long total = counts.getTotalNumberOfCheckpoints();
	long inProgress = counts.getNumberOfInProgressCheckpoints();
	long completed = counts.getNumberOfCompletedCheckpoints();
	long failed = counts.getNumberOfFailedCheckpoints();
	CheckpointStatsCounts snapshot = counts.createSnapshot();
	assertEquals(restored, snapshot.getNumberOfRestoredCheckpoints());
	assertEquals(total, snapshot.getTotalNumberOfCheckpoints());
	assertEquals(inProgress, snapshot.getNumberOfInProgressCheckpoints());
	assertEquals(completed, snapshot.getNumberOfCompletedCheckpoints());
	assertEquals(failed, snapshot.getNumberOfFailedCheckpoints());
	// Update the original
	counts.incrementRestoredCheckpoints();
	counts.incrementRestoredCheckpoints();
	counts.incrementInProgressCheckpoints();
	counts.incrementCompletedCheckpoints();
	counts.incrementInProgressCheckpoints();
	counts.incrementFailedCheckpoints();
	assertEquals(restored, snapshot.getNumberOfRestoredCheckpoints());
	assertEquals(total, snapshot.getTotalNumberOfCheckpoints());
	assertEquals(inProgress, snapshot.getNumberOfInProgressCheckpoints());
	assertEquals(completed, snapshot.getNumberOfCompletedCheckpoints());
	assertEquals(failed, snapshot.getNumberOfFailedCheckpoints());
}