public static StreamApplication getInstance(
      String systemName,
      List<String> inputTopics,
      String outputTopic,
      CountDownLatch processedMessageLatch,
      StreamApplicationCallback callback,
      CountDownLatch kafkaEventsConsumedLatch,
      Config config) {
    String appName = new ApplicationConfig(config).getGlobalAppId();
    String processorName = config.get(JobConfig.PROCESSOR_ID);
    registerLatches(processedMessageLatch, kafkaEventsConsumedLatch, callback, appName, processorName);

    StreamApplication app = new TestStreamApplication(systemName, inputTopics, outputTopic, appName, processorName);
    return app;
  }
Test class to create an {@link StreamApplication} instance
samza-test/src/test/java/org/apache/samza/test/processor/TestStreamApplication.java