class IpOwners {

  @VisibleForTesting
  static Map<String, Map<String, IpSpace>> computeInterfaceHostSubnetIps(
      Map<String, Configuration> configs, boolean excludeInactive) {
    Span span = GlobalTracer.get().buildSpan("IpOwners.computeInterfaceHostSubnetIps").start();
    try (Scope scope = GlobalTracer.get().scopeManager().activate(span)) {
      assert scope != null; // avoid unused warning
      return toImmutableMap(
          configs,
          Entry::getKey, /* hostname */
          nodeEntry ->
              toImmutableMap(
                  excludeInactive
                      ? nodeEntry.getValue().getActiveInterfaces()
                      : nodeEntry.getValue().getAllInterfaces(),
                  Entry::getKey, /* interface */
                  ifaceEntry ->
                      firstNonNull(
                          AclIpSpace.union(
                              ifaceEntry.getValue().getAllConcreteAddresses().stream()
                                  .map(ConcreteInterfaceAddress::getPrefix)
                                  .map(Prefix::toHostIpSpace)
                                  .collect(ImmutableList.toImmutableList())),
                          EmptyIpSpace.INSTANCE)));
    } finally {
      span.finish();
    }
  }

  public  IpOwners(Map<String, Configuration> configurations);

}