### Question:
WXModuleManager { static Object callModuleMethod(final String instanceId, String moduleStr, String methodStr, JSONArray args) { ModuleFactory factory = sModuleFactoryMap.get(moduleStr); if(factory == null){ WXLogUtils.e("[WXModuleManager] module factory not found."); return null; } final WXModule wxModule = findModule(instanceId, moduleStr,factory); if (wxModule == null) { return null; } WXSDKInstance instance = WXSDKManager.getInstance().getSDKInstance(instanceId); wxModule.mWXSDKInstance = instance; final Invoker invoker = factory.getMethodInvoker(methodStr); try { if(instance != null) { IWXUserTrackAdapter userTrackAdapter = WXSDKManager.getInstance().getIWXUserTrackAdapter(); if(userTrackAdapter != null) { HashMap<String, Serializable> data = new HashMap<String, Serializable>(); data.put(MONITOR_ERROR_CODE, "101"); data.put(MONITOR_ARG, moduleStr + "." + methodStr); data.put(MONITOR_ERROR_MSG, instance.getBundleUrl()); userTrackAdapter.commit(instance.getContext(), null, IWXUserTrackAdapter.INVOKE_MODULE, null, data); } return dispatchCallModuleMethod(instance,wxModule,args,invoker); } else { WXLogUtils.e("callModuleMethod >>> instance is null"); return null; } } catch (Exception e) { WXExceptionUtils.commitCriticalExceptionRT(instanceId, WXErrorCode.WX_KEY_EXCEPTION_INVOKE_REGISTER_CONTENT_FAILED.getErrorCode(), "callModuleMethod", WXErrorCode.WX_KEY_EXCEPTION_INVOKE_REGISTER_CONTENT_FAILED.getErrorMsg() + "callModuleMethod >>> invoke module:" + moduleStr + ", method:" + methodStr + " failed. " + WXLogUtils.getStackTrace(e), null); WXLogUtils.e("callModuleMethod >>> invoke module:" + moduleStr + ", method:" + methodStr + " failed. ", e); return null; } finally { if (wxModule instanceof WXDomModule || wxModule instanceof WXTimerModule) { wxModule.mWXSDKInstance = null; } } }  static boolean registerModule(final String moduleName, final ModuleFactory factory, final boolean global); static void onActivityCreate(String instanceId); static void onActivityStart(String instanceId); static void onActivityPause(String instanceId); static void onActivityResume(String instanceId); static void onActivityStop(String instanceId); static void onActivityDestroy(String instanceId); static boolean onActivityBack(String instanceId); static void onActivityResult(String instanceId,int requestCode, int resultCode, Intent data); static boolean onCreateOptionsMenu(String instanceId,Menu menu); static void onRequestPermissionsResult(String instanceId ,int requestCode, String[] permissions, int[] grantResults); static void destroyInstanceModules(String instanceId); static void createDomModule(WXSDKInstance instance); static void destoryDomModule(String instanceID); static WXDomModule getDomModule(String instanceId); static void reload();  }### Answer:
@Test public void testCallModuleMethod() throws Exception { WXModuleManager.callModuleMethod(instance.getInstanceId(),"test1","testMethod",null); WXModuleManager.callModuleMethod(instance.getInstanceId(),"test2","testMethod",null); }
@Test public void testCallModuleMethod2() throws Exception { JSONArray args = new JSONArray(); args.add("testarg"); WXModuleManager.callModuleMethod(instance.getInstanceId(),"test1","testMethod",args); }
@Test public void testCallModuleMethod3() throws Exception { JSONArray args = new JSONArray(); args.add("testarg"); args.add(null); WXModuleManager.callModuleMethod(instance.getInstanceId(),"test1","testCallbackMethod",args); }
@Test public void testCallModuleMethod4() throws Exception { JSONArray args = new JSONArray(); args.add("testarg"); args.add("testcallbackId"); WXModuleManager.callModuleMethod(instance.getInstanceId(),"test1","testCallbackMethod",args); }