WXModuleManager { public static void destroyInstanceModules(String instanceId) { HashMap<String, WXModule> moduleMap = sInstanceModuleMap.remove(instanceId); if (moduleMap == null || moduleMap.size() < 1) { return; } Iterator<Entry<String, WXModule>> iterator = moduleMap.entrySet().iterator(); Entry<String, WXModule> entry; while (iterator.hasNext()) { entry = iterator.next(); WXModule module = entry.getValue(); if(module instanceof Destroyable){ ((Destroyable)module).destroy(); } } }  static boolean registerModule(final String moduleName, final ModuleFactory factory, final boolean global); static void destroyInstanceModules(String instanceId); static void reload();  }
@Test public void testDestroyInstanceModules() throws Exception { testCallModuleMethod(); WXModuleManager.destroyInstanceModules(instance.getInstanceId()); }