class BgpSessionStatusAnswerer extends Answerer {

  @Nonnull
  @VisibleForTesting
  static Row getUnnumberedPeerRow(
      BgpPeerConfigId unnumId,
      BgpUnnumberedPeerConfig unnumPeer,
      ValueGraph<BgpPeerConfigId, BgpSessionProperties> configuredTopology,
      ValueGraph<BgpPeerConfigId, BgpSessionProperties> establishedTopology) {
    BgpSessionStatus status = NOT_COMPATIBLE;
    BgpPeerConfigId remoteId = null;
    Long localAs = unnumPeer.getLocalAs();
    String remoteAs = unnumPeer.getRemoteAsns().toString();
    Set<Type> addressFamilies = ImmutableSet.of();
    if (establishedTopology.nodes().contains(unnumId)
        && establishedTopology.outDegree(unnumId) == 1) {
      status = ESTABLISHED;
      remoteId = establishedTopology.adjacentNodes(unnumId).iterator().next();
      localAs = getLocalAs(establishedTopology, unnumId, remoteId, unnumPeer);
      remoteAs = getRemoteAs(establishedTopology, unnumId, remoteId, unnumPeer);
      addressFamilies = getAddressFamilies(establishedTopology, unnumId, remoteId);

    } else if (getConfiguredStatus(unnumId, unnumPeer, configuredTopology) == UNIQUE_MATCH) {
      status = NOT_ESTABLISHED;
      remoteId = configuredTopology.adjacentNodes(unnumId).iterator().next();
      localAs = getLocalAs(configuredTopology, unnumId, remoteId, unnumPeer);
      remoteAs = getRemoteAs(configuredTopology, unnumId, remoteId, unnumPeer);
      addressFamilies = getAddressFamilies(configuredTopology, unnumId, remoteId);
    }

    // If there's enough info to identify a remote peer, get remote node and interface
    Node remoteNode = null;
    NodeInterfacePair remoteInterface = null;
    if (remoteId != null) {
      remoteNode = new Node(remoteId.getHostname());
      remoteInterface = NodeInterfacePair.of(remoteId.getHostname(), remoteId.getPeerInterface());
    }

    return Row.builder(METADATA_MAP)
        .put(COL_ESTABLISHED_STATUS, status)
        .put(COL_ADDRESS_FAMILIES, addressFamilies)
        .put(
            COL_LOCAL_INTERFACE,
            NodeInterfacePair.of(unnumId.getHostname(), unnumPeer.getPeerInterface()))
        .put(COL_LOCAL_AS, localAs)
        .put(COL_LOCAL_IP, null)
        .put(COL_NODE, new Node(unnumId.getHostname()))
        .put(COL_REMOTE_AS, remoteAs)
        .put(COL_REMOTE_NODE, remoteNode)
        .put(COL_REMOTE_INTERFACE, remoteInterface)
        .put(COL_REMOTE_IP, null)
        .put(COL_SESSION_TYPE, getSessionType(unnumPeer))
        .put(COL_VRF, unnumId.getVrfName())
        .build();
  }

  public  BgpSessionStatusAnswerer(Question question, IBatfish batfish);

}