private static DataNodeConfigChangeListener captureRegisteredListener(DataNodeConfigSource source) throws Exception {
    ArgumentCaptor<DataNodeConfigChangeListener> listenerCaptor =
        ArgumentCaptor.forClass(DataNodeConfigChangeListener.class);
    verify(source).addDataNodeConfigChangeListener(listenerCaptor.capture());
    return listenerCaptor.getValue();
  }
@param source the mock source to get the registered listener from
@return the {@link DataNodeConfigChangeListener} captured.
ambry-clustermap/src/test/java/com/github/ambry/clustermap/CompositeDataNodeConfigSourceTest.java