private void run(StreamProcessor processor, CountDownLatch latch) {
    boolean latchResult = false;
    processor.start();
    try {
      latchResult = latch.await(10, TimeUnit.SECONDS);
    } catch (InterruptedException e) {
      e.printStackTrace();
    } finally {
      if (!latchResult) {
        Assert.fail("StreamTask either failed to process all input or timed out!");
      }
    }
    processor.stop();
  }
Runs the provided stream processor by starting it, waiting on the provided latch with a timeout,
and then stopping it.
samza-test/src/test/java/org/apache/samza/test/processor/TestStreamProcessor.java