code: public static void terminateRpcEndpoint(RpcEndpoint rpcEndpoint, Time timeout) throws ExecutionException, InterruptedException, TimeoutException {
  		rpcEndpoint.closeAsync().get(timeout.toMilliseconds(), TimeUnit.MILLISECONDS);
  	}
docs: Shuts the given {@link RpcEndpoint} down and awaits its termination.
  
  @param rpcEndpoint to terminate
  @param timeout for this operation
  @throws ExecutionException if a problem occurred
  @throws InterruptedException if the operation has been interrupted
  @throws TimeoutException if a timeout occurred