class TopologyUtil {

  public static Topology synthesizeL3Topology(Map<String, Configuration> configurations) {
    Map<Prefix, List<Interface>> prefixInterfaces = computeInterfacesBucketByPrefix(configurations);

    ImmutableSortedSet.Builder<Edge> edges = ImmutableSortedSet.naturalOrder();
    for (Entry<Prefix, List<Interface>> bucketEntry : prefixInterfaces.entrySet()) {
      Prefix p = bucketEntry.getKey();
      Set<Interface> candidateInterfaces = candidateInterfacesForPrefix(prefixInterfaces, p);

      for (Interface iface1 : bucketEntry.getValue()) {
        for (Interface iface2 : candidateInterfaces) {
          // No device self-adjacencies in the same VRF.
          if (!isValidLayer3Adjacency(iface1, iface2)) {
            continue;
          }
          // Additionally, don't connect if any of the two endpoint interfaces have Tunnel or VPN
          // interfaceTypes
          if (TUNNEL_INTERFACE_TYPES.contains(iface1.getInterfaceType())
              || TUNNEL_INTERFACE_TYPES.contains(iface2.getInterfaceType())) {
            continue;
          }
          edges.add(new Edge(iface1, iface2));
        }
      }
    }
    return new Topology(edges.build());
  }

  private  TopologyUtil();

}