code: @SuppressWarnings("unchecked")
  	@Override
  	public T getEndpoint(String nodeID) {
  		Endpoint[] array;
  		if (nodeID == null && preferLocal) {
  			array = getEndpointsByNodeID(this.nodeID);
  			if (array.length == 0) {
  				array = endpoints;
  			}
  		} else {
  			array = getEndpointsByNodeID(nodeID);
  		}
  		if (array.length == 0) {
  			return null;
  		}
  		if (array.length == 1) {
  			return (T) array[0];
  		}
  		return (T) next(array);
  	}
docs: --- GET LOCAL OR REMOTE ENDPOINT ---