@Override
  public void process(IncomingMessageEnvelope envelope, MessageCollector collector, TaskCoordinator coordinator) {
    messagesProcessed += 1;
    String input = (String) envelope.getMessage();
    Integer number = Integer.valueOf(input);
    Integer output = number.intValue() * -1;
    collector.send(new OutgoingMessageEnvelope(outputSystemStream, output.toString()));
    if (messagesProcessed >= maxMessages) {
      coordinator.shutdown(RequestScope.ALL_TASKS_IN_CONTAINER);
    }
  }
The SystemStream to send negated numbers to.
samza-test/src/main/java/org/apache/samza/test/integration/NegateNumberTask.java