@Test
public void testRandomStats() throws Exception {

	CompletedCheckpoint[] checkpoints = generateRandomCheckpoints(16);
	ExecutionVertex[] tasksToWaitFor = createTasksToWaitFor(checkpoints[0]);
	CheckpointStatsTracker tracker = new SimpleCheckpointStatsTracker(10, tasksToWaitFor);
	for (int i = 0; i < checkpoints.length; i++) {
		CompletedCheckpoint checkpoint = checkpoints[i];
		tracker.onCompletedCheckpoint(checkpoint);
		verifyJobStats(tracker, 10, Arrays.copyOfRange(checkpoints, 0, i + 1));
		verifySubtaskStats(tracker, tasksToWaitFor, checkpoint);
	}
}