@SuppressWarnings("unchecked")
  public void init(Context context) {
    this.store = (KeyValueStore<String, String>) context.getTaskContext().getStore("mystore");
    System.out.println("Contents of store: ");
    KeyValueIterator<String, String> iter = store.all();
    while (iter.hasNext()) {
      Entry<String, String> entry = iter.next();
      System.out.println(entry.getKey() + " => " + entry.getValue());
    }
    iter.close();
  }
This is a simple task that writes each message to a state store and prints them all out on reload.

It is useful for command line testing with the kafka console producer and consumer and text messages.
samza-test/src/main/java/org/apache/samza/test/integration/SimpleStatefulTask.java