@Test
  public void testReadNullRecordWhenSendMessageToLocalListeners() throws Exception {
    helixNotifier = new HelixNotifier(new MockHelixPropertyStore<ZNRecord>(false, true));
    helixNotifier.publish(refTopics.get(0), refMessages.get(0));
    helixNotifier.subscribe(refTopics.get(0), listeners.get(0));
    latch0.set(new CountDownLatch(1));
    helixNotifier.publish(refTopics.get(0), refMessages.get(0));
    assertEquals("TopicListener incorrectly called when the record is null", 1, latch0.get().getCount());
  }
Tests a corner case when a {@link HelixNotifier} sends messages to local {@link TopicListener}s, there is a
slight chance that when the {@link HelixNotifier} tries to fetch the message, it is already deleted by someone
else, and may fetch {@code null}. This test ensures that in this case no exception will be thrown.
@throws Exception Any unexpected exception.
ambry-commons/src/test/java/com/github/ambry/commons/HelixNotifierTest.java