public void testStop() throws NoSuchFieldException, IllegalAccessException {

    //checks before stopping
    assertTrue(systemProducer.isStarted());

    //stop and check if stop has been done correctly
    coordinatorStreamWriter.stop();
    assertTrue(systemProducer.isStopped());
  }
This class is a unit test for the CoordinatorStreamWriter class.
samza-core/src/test/java/org/apache/samza/coordinator/stream/TestCoordinatorStreamWriter.java