@Override
  public boolean publish(String topic, T message) {
    if (topic == null || message == null) {
      throw new IllegalArgumentException("topic or message cannot be null.");
    }
    Set<TopicListener<T>> listeners = topicToListenersMap.get(topic);
    if (listeners != null) {
      for (TopicListener listener : listeners) {
        listener.onMessage(topic, message);
      }
    }
    return true;
  }
A mock implementation of {@link Notifier}. The methods in this class are synchronous, and this class is
not thread-safe and supposed to be called from a single thread.
@param <T> The type of message.
ambry-account/src/test/java/com/github/ambry/account/MockNotifier.java