class CompletionMetadataUtils {

  public static Set<Location> getSourceLocationsWithSrcIps(
      Map<Location, LocationInfo> locationInfo) {
    IpSpaceToBDD toBdd = new BDDPacket().getDstIpSpaceToBDD();
    return locationInfo.entrySet().stream()
        .filter(
            entry -> {
              LocationInfo info = entry.getValue();
              return info.isSource() && !toBdd.visit(info.getSourceIps()).isZero();
            })
        .map(Entry::getKey)
        .collect(ImmutableSet.toImmutableSet());
  }

  private  CompletionMetadataUtils();

}