@Override
    public void onMessage(String topic, String message) {
      System.out.println("Topic is: " + topic + ", referenceMessage1 is: " + message);
      receivedTopics.add(topic);
      receivedMessages.add(message);
      if (latch.get().getCount() > 0) {
        latch.get().countDown();
      } else {
        // since this callback is called in the main thread, it is ok to fail the test here.
        fail("Countdown latch has already been counted down to 0");
      }
    }
A {@link TopicListener} for test purpose. It will count down the passed in latch after it has processed the
message.
ambry-commons/src/test/java/com/github/ambry/commons/HelixNotifierTest.java