### Question:
AdvertisingPacketFactory { protected AP createAdvertisingPacketWithSubFactories(byte[] advertisingData) { for (AdvertisingPacketFactory<AP> advertisingPacketFactory : subFactoryMap.values()) { if (advertisingPacketFactory.canCreateAdvertisingPacketWithSubFactories(advertisingData)) { return advertisingPacketFactory.createAdvertisingPacket(advertisingData); } } return createAdvertisingPacket(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 createAdvertisingPacketWithSubFactories_hasNoSubFactories_createsCorrectPacket() { IBeaconAdvertisingPacketFactory advertisingPacketFactory = new IBeaconAdvertisingPacketFactory(); AdvertisingPacket advertisingPacket = advertisingPacketFactory.createAdvertisingPacketWithSubFactories(BeaconTest.IBEACON_ADVERTISING_DATA); assertTrue(advertisingPacket instanceof IBeaconAdvertisingPacket); }