MultiProtocolCapability extends Capability { public AddressFamilyKey toAddressFamilyKey() { return new AddressFamilyKey(getAfi(), getSafi()); } MultiProtocolCapability();  MultiProtocolCapability(AddressFamily afi, SubsequentAddressFamily safi); AddressFamily getAfi(); void setAfi(AddressFamily afi); SubsequentAddressFamily getSafi(); void setSafi(SubsequentAddressFamily safi); AddressFamilyKey toAddressFamilyKey(); @Override String toString();  }
@Test public void testToAddressFamilyKey() { List<AddressFamily> afList = Arrays.asList(AddressFamily.APPLETALK, AddressFamily.BANYAN, AddressFamily.BBN1882, AddressFamily.DECNET4, AddressFamily.E163, AddressFamily.E164, AddressFamily.F69, AddressFamily.HDLC, AddressFamily.IEEE802, AddressFamily.IPv4, AddressFamily.IPv6, AddressFamily.IPX, AddressFamily.NSAP, AddressFamily.X121); List<SubsequentAddressFamily> safList = Arrays.asList(SubsequentAddressFamily.NLRI_MULTICAST_FORWARDING, SubsequentAddressFamily.NLRI_UNICAST_FORWARDING, SubsequentAddressFamily.NLRI_UNICAST_MULTICAST_FORWARDING); for(AddressFamily afi : afList) { for(SubsequentAddressFamily safi : safList) { MultiProtocolCapability mpcap = new MultiProtocolCapability(afi, safi); Assert.assertEquals(new AddressFamilyKey(afi, safi), mpcap.toAddressFamilyKey()); } } }