### Question:
AdvertisingPacketFactory { protected boolean canCreateAdvertisingPacketWithSubFactories(byte[] advertisingData) { for (AdvertisingPacketFactory<AP> advertisingPacketFactory : subFactoryMap.values()) { if (advertisingPacketFactory.canCreateAdvertisingPacketWithSubFactories(advertisingData)) { return true; } } return canCreateAdvertisingPacket(advertisingData); } AdvertisingPacketFactory(Class<AP> packetClass); AdvertisingPacketFactory<AP> getAdvertisingPacketFactory(Class advertisingPacketClass); AdvertisingPacketFactory<AP> getAdvertisingPacketFactory(byte[] advertisingData); void addAdvertisingPacketFactory(F factory); void removeAdvertisingPacketFactory(Class<AP> advertisingPacketClass); void removeAdvertisingPacketFactory(F factory); Class<AP> getPacketClass();  }### Answer:
@Test public void canCreateAdvertisingPacket_validData_returnsTrue() { IBeaconAdvertisingPacketFactory advertisingPacketFactory = new IBeaconAdvertisingPacketFactory(); assertTrue(advertisingPacketFactory.canCreateAdvertisingPacketWithSubFactories(BeaconTest.IBEACON_ADVERTISING_DATA)); }