class TopologyUtil {

  public static @Nonnull Layer1Topology cleanLayer1PhysicalTopology(
      @Nonnull Layer1Topology rawLayer1Topology,
      @Nonnull Map<String, Configuration> configurations) {
    ImmutableSet.Builder<Layer1Edge> edges = ImmutableSet.builder();
    rawLayer1Topology.getGraph().edges().stream()
        .filter(
            edge -> {
              Interface i1 = getInterface(edge.getNode1(), configurations);
              Interface i2 = getInterface(edge.getNode2(), configurations);
              return i1 != null && i2 != null && i1.getActive() && i2.getActive();
            })
        .forEach(
            edge -> {
              edges.add(edge);
              edges.add(edge.reverse());
            });
    /* Filter out inactive interfaces */
    return new Layer1Topology(edges.build());
  }

  private  TopologyUtil();

}