@Test
  public void testOneListenerForTwoDifferentTopics() throws Exception {
    helixNotifier.subscribe(refTopics.get(0), listeners.get(0));
    helixNotifier.subscribe(refTopics.get(1), listeners.get(0));
    latch0.set(new CountDownLatch(2));
    helixNotifier.publish(refTopics.get(0), refMessages.get(0));
    helixNotifier.publish(refTopics.get(1), refMessages.get(1));
    awaitLatchOrTimeout(latch0.get(), LATCH_TIMEOUT_MS);
    assertEquals("Received topics are different from expected", new HashSet<>(refTopics),
        new HashSet<>(receivedTopicsByListener0));
    assertEquals("Received messages are different from expected", new HashSet<>(refMessages),
        new HashSet<>(receivedMessagesByListener0));
  }
Tests one {@link TopicListener} simultaneously listens to two different topics through the same {@link HelixNotifier}.
@throws Exception Any unexpected exceptions.
ambry-commons/src/test/java/com/github/ambry/commons/HelixNotifierTest.java