class EdgesAnswerer extends Answerer {

  @VisibleForTesting
  static Multiset<Row> getBgpEdges(
      Map<String, Configuration> configurations,
      Set<String> includeNodes,
      Set<String> includeRemoteNodes,
      BgpTopology bgpTopology) {
    Multiset<Row> rows = HashMultiset.create();
    Map<String, ColumnMetadata> columnMap = getTableMetadata(EdgeType.BGP).toColumnMap();
    for (EndpointPair<BgpPeerConfigId> session : bgpTopology.getGraph().edges()) {
      BgpPeerConfigId bgpPeerConfigId = session.source();
      BgpPeerConfigId remoteBgpPeerConfigId = session.target();
      NetworkConfigurations nc = NetworkConfigurations.of(configurations);
      BgpPeerConfig bgpPeerConfig = nc.getBgpPeerConfig(bgpPeerConfigId);
      BgpPeerConfig remoteBgpPeerConfig = nc.getBgpPeerConfig(remoteBgpPeerConfigId);
      if (bgpPeerConfig == null || remoteBgpPeerConfig == null) {
        continue;
      }
      String hostname = bgpPeerConfigId.getHostname();
      String remoteHostname = remoteBgpPeerConfigId.getHostname();
      if (includeNodes.contains(hostname) && includeRemoteNodes.contains(remoteHostname)) {
        BgpSessionProperties sessionProperties =
            bgpTopology.getGraph().edgeValue(bgpPeerConfigId, remoteBgpPeerConfigId).orElse(null);
        assert sessionProperties != null;
        // Leave IPs null for BGP unnumbered session
        boolean unnumbered = bgpPeerConfigId.getType() == BgpPeerConfigType.UNNUMBERED;
        rows.add(
            Row.builder(columnMap)
                .put(COL_NODE, new Node(hostname))
                .put(COL_IP, unnumbered ? null : sessionProperties.getTailIp())
                .put(COL_INTERFACE, bgpPeerConfigId.getPeerInterface())
                .put(COL_AS_NUMBER, sessionProperties.getTailAs())
                .put(COL_REMOTE_NODE, new Node(remoteHostname))
                .put(COL_REMOTE_IP, unnumbered ? null : sessionProperties.getHeadIp())
                .put(COL_REMOTE_INTERFACE, remoteBgpPeerConfigId.getPeerInterface())
                .put(COL_REMOTE_AS_NUMBER, sessionProperties.getHeadAs())
                .build());
      }
    }

    return rows;
  }

    EdgesAnswerer(Question question, IBatfish batfish);

}