This method collects the information regarding endpoints.

@param nodes The nodes
@param endpoints The list of endpoints
551870
protected void obtainEndpoints(List<Node> nodes, List<EndpointInfo> endpoints) {
        for (int i = 0; i < nodes.size(); i++) {
            Node node = nodes.get(i);

            if (node.getUri() != null) {
                EndpointInfo ei=new EndpointInfo();
                ei.setEndpoint(EndpointUtil.encodeEndpoint(node.getUri(), node.getOperation()));

                if (!endpoints.contains(ei)) {
                    initEndpointInfo(ei);
                    endpoints.add(ei);
                }
            }

            if (node instanceof ContainerNode) {
                obtainEndpoints(((ContainerNode) node).getNodes(), endpoints);
            }
        }
    }
996235
func (endpoints EndpointList) Nodes() int {
	uniqueNodes := set.NewStringSet()
	for _, endpoint := range endpoints {
		if uniqueNodes.Contains(endpoint.Host) {
			continue
		}
		uniqueNodes.Add(endpoint.Host)
	}
	return len(uniqueNodes)
}
735400
public void addEdge(final Collection<HypergraphNode<T>> nodes) {
    final HypergraphEdge<T> edge = new HypergraphEdge<>(nodes);
    this.nodes.addAll(nodes);
    this.edges.add(edge);
  }
462652
public void setClusterNodes(java.util.Collection<ClusterNode> clusterNodes) {
        if (clusterNodes == null) {
            this.clusterNodes = null;
            return;
        }

        this.clusterNodes = new com.amazonaws.internal.SdkInternalList<ClusterNode>(clusterNodes);
    }
1137373
public void setConnectionStatuses(java.util.Collection<TerminateConnectionStatus> connectionStatuses) {
        if (connectionStatuses == null) {
            this.connectionStatuses = null;
            return;
        }

        this.connectionStatuses = new com.amazonaws.internal.SdkInternalList<TerminateConnectionStatus>(connectionStatuses);
    }
105921
private Iterable<ServiceEndPoint> getValidEndPoints(Iterable<ServiceEndPoint> endPoints) {
        return Iterables.filter(endPoints, _badEndPointFilter);
    }
392570
public void setGateways(java.util.Collection<GatewaySummary> gateways) {
        if (gateways == null) {
            this.gateways = null;
            return;
        }

        this.gateways = new java.util.ArrayList<GatewaySummary>(gateways);
    }
1012223
@Override
    public CFEndPoint[] getEndPoints(CFEndPoint[] endPointList, CFEndPointCriteria criteria) {
        return commonGetEndPoints(endPointList, criteria, false);
    }
1284350
private void setUrlParserFromEndpoints(List<String> endpoints, int port) {
    List<HostAddress> addresses = new ArrayList<>();
    for (String endpoint : endpoints) {
      HostAddress newHostAddress = new HostAddress(endpoint, port, null);
      addresses.add(newHostAddress);
    }

    synchronized (urlParser) {
      urlParser.setHostAddresses(addresses);
    }
  }
60559
protected final void addEndpoint(Endpoint e) {
        final List<Endpoint> newEndpoints;
        endpointsLock.lock();
        try {
            List<Endpoint> newEndpointsUnsorted = Lists.newArrayList(endpoints);
            newEndpointsUnsorted.add(e);
            endpoints = newEndpoints = ImmutableList.sortedCopyOf(newEndpointsUnsorted);
        } finally {
            endpointsLock.unlock();
        }

        notifyListeners(newEndpoints);
        completeInitialEndpointsFuture(newEndpoints);
    }
368068
public void setSupportedEndpointTypes(java.util.Collection<SupportedEndpointType> supportedEndpointTypes) {
        if (supportedEndpointTypes == null) {
            this.supportedEndpointTypes = null;
            return;
        }

        this.supportedEndpointTypes = new java.util.ArrayList<SupportedEndpointType>(supportedEndpointTypes);
    }
923738
public void setBackends(java.util.Collection<Backend> backends) {
        if (backends == null) {
            this.backends = null;
            return;
        }

        this.backends = new java.util.ArrayList<Backend>(backends);
    }
637850
protected void obtainProducerEndpoints(List<Node> nodes, List<EndpointInfo> endpoints,
                                Map<String, EndpointInfo> map) {
        for (int i = 0; i < nodes.size(); i++) {
            Node node = nodes.get(i);

            if (node instanceof Producer) {
                String endpoint = EndpointUtil.encodeEndpoint(node.getUri(), node.getOperation());

                if (!map.containsKey(endpoint)) {
                    EndpointInfo info = new EndpointInfo();
                    info.setEndpoint(endpoint);
                    info.setType(((Producer) node).getEndpointType());
                    endpoints.add(info);
                    map.put(endpoint, info);
                }
            }

            if (node instanceof ContainerNode) {
                obtainProducerEndpoints(((ContainerNode) node).getNodes(), endpoints, map);
            }
        }
    }
1364759
public void setIngestEndpoints(java.util.Collection<IngestEndpoint> ingestEndpoints) {
        if (ingestEndpoints == null) {
            this.ingestEndpoints = null;
            return;
        }

        this.ingestEndpoints = new java.util.ArrayList<IngestEndpoint>(ingestEndpoints);
    }
902925
private static Endpoint selectFirstConnected(final List<Endpoint> endpoints) {
        for (Endpoint endpoint : endpoints) {
            if (endpoint.isState(LifecycleState.CONNECTED) && endpoint.isFree()) {
                return endpoint;
            }
        }
        return null;
    }
796464
public static List<Online> newOnline(Collection<Node> nodes) {
        return nodes.stream().map(Online::new).collect(Collectors.toList());
    }
668568
public void setEndpoint(String endpoint) {
        this.endpoint = endpoint;

        if (bugsnag != null) {
            bugsnag.setEndpoints(endpoint, null);
        }
    }