@Override
  public void addJoinLeaveListener(JoinLeaveListener observer) {
    synchronized (listenersLock) {
      Set<JoinLeaveListener> oldListeners = listeners;
      if (!oldListeners.contains(observer)) {
        Set<JoinLeaveListener> newListeners = new HashSet<>(oldListeners);
        newListeners.add(observer);
        listeners = newListeners;
      }
    }
  }
Registers a {@code JoinLeaveListener}. on this agent that is notified when membership in
the distributed system changes.
geode-core/src/main/java/org/apache/geode/internal/admin/remote/RemoteGfManagerAgent.java