@Test
  public void testInstantiateProducer() {
    KafkaSystemProducer ksp = new KafkaSystemProducer("SysName", new ExponentialSleepStrategy(2.0, 200, 10000),
      new AbstractFunction0<Producer<byte[], byte[]>>() {
        @Override
        public Producer<byte[], byte[]> apply() {
          return new KafkaProducer<>(new HashMap<String, Object>());
        }
      }, new KafkaSystemProducerMetrics("SysName", new MetricsRegistryMap()), new AbstractFunction0<Object>() {
        @Override
        public Object apply() {
          return System.currentTimeMillis();
        }
      }, false);

    long now = System.currentTimeMillis();
    assertTrue((Long) ksp.clock().apply() >= now);
  }
Tests the instantiation of a KafkaSystemProducer from Java clients
samza-kafka/src/test/java/org/apache/samza/system/kafka/TestKafkaSystemProducerJava.java