code: public static LeaderConnectionInfo retrieveLeaderConnectionInfo(
  			LeaderRetrievalService leaderRetrievalService,
  			FiniteDuration timeout
  	) throws LeaderRetrievalException {
  		LeaderConnectionInfoListener listener = new LeaderConnectionInfoListener();
  
  		try {
  			leaderRetrievalService.start(listener);
  
  			Future<LeaderConnectionInfo> connectionInfoFuture = listener.getLeaderConnectionInfoFuture();
  
  			return Await.result(connectionInfoFuture, timeout);
  		} catch (Exception e) {
  			throw new LeaderRetrievalException("Could not retrieve the leader address and leader " +
  					"session ID.", e);
  		} finally {
  			try {
  				leaderRetrievalService.stop();
  			} catch (Exception fe) {
  				LOG.warn("Could not stop the leader retrieval service.", fe);
  			}
  		}
  	}
docs: Retrieves the leader akka url and the current leader session ID. The values are stored in a
  {@link LeaderConnectionInfo} instance.
  
  @param leaderRetrievalService Leader retrieval service to retrieve the leader connection
  information
  @param timeout Timeout when to give up looking for the leader
  @return LeaderConnectionInfo containing the leader's akka URL and the current leader session
  ID
  @throws LeaderRetrievalException