class ForwardingAnalysisImpl implements ForwardingAnalysis, Serializable {

  @VisibleForTesting
  static Map<String, Map<String, Map<Edge, IpSpace>>> computeArpTrueEdge(
      Map<String, Map<String, Map<Edge, IpSpace>>> arpTrueEdgeDestIp,
      Map<String, Map<String, Map<Edge, IpSpace>>> arpTrueEdgeNextHopIp) {
    Span span = GlobalTracer.get().buildSpan("ForwardingAnalysisImpl.computeArpTrueEdge").start();
    try (Scope scope = GlobalTracer.get().scopeManager().activate(span)) {
      assert scope != null; // avoid unused warning
      return toImmutableMap(
          arpTrueEdgeDestIp,
          Entry::getKey, // node
          nodeEntry ->
              toImmutableMap(
                  nodeEntry.getValue(),
                  Entry::getKey, // vrf
                  vrfEntry -> {
                    Map<Edge, IpSpace> dstIp = vrfEntry.getValue();
                    Map<Edge, IpSpace> nextHopIp =
                        arpTrueEdgeNextHopIp.get(nodeEntry.getKey()).get(vrfEntry.getKey());
                    return Sets.union(dstIp.keySet(), nextHopIp.keySet()).stream()
                        .collect(
                            ImmutableMap.toImmutableMap(
                                Function.identity(),
                                edge -> AclIpSpace.union(dstIp.get(edge), nextHopIp.get(edge))));
                  }));
    } finally {
      span.finish();
    }
  }

  public  ForwardingAnalysisImpl(
      Map<String, Configuration> configurations,
      Map<String, Map<String, Fib>> fibs,
      Topology topology,
      Map<Location, LocationInfo> locationInfo);

}