### Question:
AccessPointMonitord extends AbstractServiceDaemon implements ReadyRunnable { public Set<String> getActivePackageNames() { synchronized (m_activePollers) { return m_activePollers.keySet(); } } AccessPointMonitord(); boolean isInitialized(); AccessPointDao getAccessPointDao(); void setAccessPointDao(AccessPointDao accessPointDao); NodeDao getNodeDao(); void setNodeDao(NodeDao nodeDao); IpInterfaceDao getIpInterfaceDao(); void setIpInterfaceDao(IpInterfaceDao ipInterfaceDao); Scheduler getScheduler(); void setScheduler(LegacyScheduler scheduler); EventIpcManager getEventManager(); void setEventManager(EventIpcManager eventMgr); AccessPointMonitorConfig getPollerConfig(); void setPollerConfig(AccessPointMonitorConfig accesspointmonitorConfig); static void setInstance(AccessPointMonitord apm); static AccessPointMonitord getInstance(); @EventHandler(uei = EventConstants.RELOAD_DAEMON_CONFIG_UEI) void reloadDaemonConfig(Event e); @Override void run(); @Override boolean isReady(); Set<String> getActivePackageNames();  }### Answer:
@Test public void testDynamicPackages() throws Exception { addNewAccessPoint("ap1", AP1_MAC, "dynamic-pkg-1"); initApmdWithConfig(getDynamicPackageConfig()); m_apm.start(); sleep(PACKAGE_WAIT_INTERVAL); assertEquals(1, m_apm.getActivePackageNames().size()); addNewAccessPoint("ap2", AP2_MAC, "dynamic-pkg-2"); addNewAccessPoint("ap3", AP3_MAC, "default"); awaitPackageSize(2); OnmsAccessPoint ap1 = m_accessPointDao.findByPhysAddr(AP1_MAC); ap1.setPollingPackage("default"); m_accessPointDao.update(ap1); m_accessPointDao.flush(); List<String> packageNames = m_accessPointDao.findDistinctPackagesLike("dynamic-pkg-%"); assertEquals(1, packageNames.size()); awaitPackageSize(1); ap1.setPollingPackage("dynamic-pkg-2"); m_accessPointDao.update(ap1); m_accessPointDao.flush(); awaitPackageSize(1); updateConfigAndReloadDaemon(getDynamicPackageConfig(), true); awaitPackageSize(1); }