Returns a list of {@link Router}s.
439587
@VisibleForTesting
    static <V> List<Router<V>> routers(Iterable<V> values, Function<V, PathMapping> pathMappingResolver,
                                       BiConsumer<PathMapping, PathMapping> rejectionHandler) {
        rejectDuplicateMapping(values, pathMappingResolver, rejectionHandler);

        final ImmutableList.Builder<Router<V>> builder = ImmutableList.builder();
        final List<V> group = new ArrayList<>();

        boolean addingTrie = true;

        for (V value : values) {
            final PathMapping mapping = pathMappingResolver.apply(value);
            final boolean triePathPresent = mapping.triePath().isPresent();
            if (addingTrie && triePathPresent || !addingTrie && !triePathPresent) {
                // We are adding the same type of PathMapping to 'group'.
                group.add(value);
                continue;
            }

            // Changed the router type.
            if (!group.isEmpty()) {
                builder.add(router(addingTrie, group, pathMappingResolver));
            }
            addingTrie = !addingTrie;
            group.add(value);
        }
        if (!group.isEmpty()) {
            builder.add(router(addingTrie, group, pathMappingResolver));
        }
        return builder.build();
    }
1214793
def subrouters(self):
        
        yield from filter(lambda mw: isinstance(mw.func, Router), self.mw_list)
217438
public java.util.List<TransitGateway> getTransitGateways() {
        if (transitGateways == null) {
            transitGateways = new com.amazonaws.internal.SdkInternalList<TransitGateway>();
        }
        return transitGateways;
    }
1066443
public final List<SIDestinationAddress> getReverseRoutingPath() {
        List<String> fNames = (List<String>) getHdr2().getField(JsHdr2Access.REVERSEROUTINGPATH_DESTINATIONNAME);
        List<byte[]> fMEs = (List<byte[]>) getHdr2().getField(JsHdr2Access.REVERSEROUTINGPATH_MEID);
        byte[] fLos = (byte[]) getHdr2().getField(JsHdr2Access.REVERSEROUTINGPATHLOCALONLY);
        List<String> fBuses = (List<String>) getHdr2().getField(JsHdr2Access.REVERSEROUTINGPATH_BUSNAME);
        return new RoutingPathList(fNames, fLos, fMEs, fBuses);
    }
61309
public java.util.List<RouteFilterPrefix> getOverrideAllowedPrefixesToDirectConnectGateway() {
        if (overrideAllowedPrefixesToDirectConnectGateway == null) {
            overrideAllowedPrefixesToDirectConnectGateway = new com.amazonaws.internal.SdkInternalList<RouteFilterPrefix>();
        }
        return overrideAllowedPrefixesToDirectConnectGateway;
    }
1286949
public Iterator<String> list() {
        try {
            final Enumeration<String> keys = pathRegistry.keys();
            return new Iterator<String>() {
                public boolean hasNext() { return keys.hasMoreElements(); }
                public String next() { return keys.nextElement(); }
                public void remove() { throw new UnsupportedOperationException(); }
            };
        } catch (LowlevelStorageException e) {
            throw new FaultException(e);
        }
    }
802166
def list_l3_agent_hosting_routers(self, router, **_params):
        """"""
        return self.get((self.router_path + self.L3_AGENTS) % router,
                        params=_params)
65905
public java.util.List<String> getDnsIpAddresses() {
        if (dnsIpAddresses == null) {
            dnsIpAddresses = new com.amazonaws.internal.SdkInternalList<String>();
        }
        return dnsIpAddresses;
    }
634932
public java.util.List<TransitGatewayRouteTable> getTransitGatewayRouteTables() {
        if (transitGatewayRouteTables == null) {
            transitGatewayRouteTables = new com.amazonaws.internal.SdkInternalList<TransitGatewayRouteTable>();
        }
        return transitGatewayRouteTables;
    }
74920
public ArrayList<InetAddress> getLocalAddresses()
  {
    synchronized (_addressCache) {
      ArrayList<InetAddress> localAddresses = _addressCache.get("addresses");
      
      if (localAddresses == null) {
        localAddresses = new ArrayList<InetAddress>();
        
        try {
          for (NetworkInterfaceBase iface : getNetworkInterfaces()) {
            for (InetAddress addr : iface.getInetAddresses()) {
              localAddresses.add(addr);
            }
          }
          
          Collections.sort(localAddresses, new LocalIpCompare());
          
          _addressCache.put("addresses", localAddresses);
        } catch (Exception e) {
          log.log(Level.WARNING, e.toString(), e);
        } finally {
          _addressCache.put("addresses", localAddresses);
        }
      }
      
      return new ArrayList<>(localAddresses);
    }
  }
453955
@Pure
	public static Collection<InetAddress> getPrimaryAdapterAddresses() {
		final Enumeration<NetworkInterface> interfaces;
		try {
			interfaces = NetworkInterface.getNetworkInterfaces();
		} catch (SocketException exception) {
			return Collections.emptyList();
		}
		if (interfaces != null) {
			NetworkInterface inter;
			while (interfaces.hasMoreElements()) {
				inter = interfaces.nextElement();
				try {
					final byte[] addr = inter.getHardwareAddress();
					if (addr != null) {
						final Collection<InetAddress> inetList = new ArrayList<>();
						final Enumeration<InetAddress> inets = inter.getInetAddresses();
						while (inets.hasMoreElements()) {
							inetList.add(inets.nextElement());
						}
						return inetList;
					}
				} catch (SocketException exception) {
					// Continue to the next loop.
				}
			}
		}
		return Collections.emptyList();
	}
33312
public static List<NetworkInterface> getNetworkInterfaces() {
        List<NetworkInterface> networkInterfaces = new LinkedList<NetworkInterface>();

        List<String> macs = getItems(EC2_METADATA_ROOT + "/network/interfaces/macs/");
        if (macs != null) {
            for (String mac : macs) {
                String key = mac.trim();
                if (key.endsWith("/")) {
                    key = key.substring(0, key.length() - 1);
                }
                networkInterfaces.add(new NetworkInterface(key));
            }
        }
        return networkInterfaces;
    }
200946
public List<URL> getURLs() {
        final List<URL> resourceURLs = new ArrayList<>(this.size());
        for (final Resource resource : this) {
            resourceURLs.add(resource.getURL());
        }
        return resourceURLs;
    }
1149519
public static ProviderList getProviderList() {
        ProviderList list = getThreadProviderList();
        if (list == null) {
            list = getSystemProviderList();
        }
        return list;
    }
163642
public static Collection<NetworkInterface> getNetworkInterfaces() {
		Enumeration<NetworkInterface> networkInterfaces = null;
		try {
			networkInterfaces = NetworkInterface.getNetworkInterfaces();
		} catch (SocketException e) {
			return null;
		}

		return CollectionUtil.addAll(new ArrayList<NetworkInterface>(), networkInterfaces);
	}
1257124
public java.util.List<RouteFilterPrefix> getRequestedAllowedPrefixesToDirectConnectGateway() {
        if (requestedAllowedPrefixesToDirectConnectGateway == null) {
            requestedAllowedPrefixesToDirectConnectGateway = new com.amazonaws.internal.SdkInternalList<RouteFilterPrefix>();
        }
        return requestedAllowedPrefixesToDirectConnectGateway;
    }
185190
public PagedList<ExpressRouteGatewayInner> list() {
        PageImpl1<ExpressRouteGatewayInner> page = new PageImpl1<>();
        page.setItems(listWithServiceResponseAsync().toBlocking().single().body());
        page.setNextPageLink(null);
        return new PagedList<ExpressRouteGatewayInner>(page) {
            @Override
            public Page<ExpressRouteGatewayInner> nextPage(String nextPageLink) {
                return null;
            }
        };
    }