private void produceMessages(int partitionId) {
    String key = "key" + partitionId;
    // commit first message
    produceMessage(INPUT_STREAM, partitionId, key, commitMessage(partitionId, 0));
    // don't commit second message
    produceMessage(INPUT_STREAM, partitionId, key, noCommitMessage(partitionId, 1));
    // do an initial shutdown so that the test can check that the second message gets re-processed
    produceMessage(INPUT_STREAM, partitionId, key, INTERMEDIATE_SHUTDOWN);
    // do a commit on the third message
    produceMessage(INPUT_STREAM, partitionId, key, commitMessage(partitionId, 2));
    // this will make the task shut down for the second run
    produceMessage(INPUT_STREAM, partitionId, key, END_OF_STREAM);
  }
If message equals this string, then shut down the task.
samza-test/src/test/java/org/apache/samza/test/kafka/KafkaCheckpointManagerIntegrationTest.java