class SwitchedVlanPropertiesAnswerer extends Answerer {

  @VisibleForTesting
  static void tryAddInterfaceToVlans(
      Set<NodeInterfacePair> specifiedInterfaces,
      boolean excludeShutInterfaces,
      IntegerSpace vlans,
      Map<Integer, Builder<NodeInterfacePair>> switchedVlanInterfaces,
      Interface iface) {
    NodeInterfacePair ifacePair = NodeInterfacePair.of(iface);
    if (!specifiedInterfaces.contains(ifacePair)
        || (excludeShutInterfaces && !iface.getActive())
        || (iface.getInterfaceType() != InterfaceType.VLAN
            && !Boolean.TRUE.equals(iface.getSwitchport()))) {
      return;
    }
    if (iface.getInterfaceType() == InterfaceType.VLAN) {
      // Add VLAN associated with IRB-type interface
      tryAddInterfaceToVlan(switchedVlanInterfaces, ifacePair, iface.getVlan(), vlans);
    } else if (iface.getSwitchportMode() == SwitchportMode.ACCESS) {
      // Add access VLAN when in ACCESS mode
      tryAddInterfaceToVlan(switchedVlanInterfaces, ifacePair, iface.getAccessVlan(), vlans);
    } else if (iface.getSwitchportMode() == SwitchportMode.TRUNK) {
      // Add allowed VLANs when in TRUNK mode
      iface.getAllowedVlans().stream()
          .forEach(
              allowedVlan ->
                  tryAddInterfaceToVlan(switchedVlanInterfaces, ifacePair, allowedVlan, vlans));
    }
  }

  public  SwitchedVlanPropertiesAnswerer(Question question, IBatfish batfish);

}