### Question:
JsonRuntimeReporterHelper { public synchronized void insertConfigMethod(String suite, String test, String packages, String classname, ITestResult result) { logger.entering(new Object[] { suite, test, packages, classname, result }); String type = null; if (result.getMethod().isBeforeSuiteConfiguration()) { type = BEFORE_SUITE; } else if (result.getMethod().isBeforeTestConfiguration()) { type = BEFORE_TEST; } else if (result.getMethod().isBeforeGroupsConfiguration()) { type = BEFORE_GROUP; } else if (result.getMethod().isBeforeClassConfiguration()) { type = BEFORE_CLASS; } else if (result.getMethod().isBeforeMethodConfiguration()) { type = BEFORE_METHOD; } else if (result.getMethod().isAfterSuiteConfiguration()) { type = AFTER_SUITE; } else if (result.getMethod().isAfterTestConfiguration()) { type = AFTER_TEST; } else if (result.getMethod().isAfterGroupsConfiguration()) { type = AFTER_GROUP; } else if (result.getMethod().isAfterClassConfiguration()) { type = AFTER_CLASS; } else if (result.getMethod().isAfterMethodConfiguration()) { type = AFTER_METHOD; } ConfigMethodInfo config1 = new ConfigMethodInfo(suite, test, packages, classname, type, result); if (result.getStatus() == ITestResult.STARTED) { runningConfig.add(config1); return; } for (ConfigMethodInfo temp : runningConfig) { if (temp.getResult().getMethod().equals(result.getMethod())) { runningConfig.remove(temp); break; } } appendFile(jsonCompletedConfig, config1.toJson().concat(",\n")); logger.exiting(); } JsonRuntimeReporterHelper(); void generateLocalConfigSummary(String suiteName, String testName); synchronized void insertTestMethod(String suite, String test, String packages, String classname,
            ITestResult result); synchronized void insertConfigMethod(String suite, String test, String packages, String classname,
            ITestResult result); synchronized void writeJSON(String outputDirectory, boolean bForceWrite); List<TestMethodInfo> getCompletedTestContent(); JsonArray getCompletedConfigContent(); static final String IS_COMPLETED; }### Answer:
@Test(groups = "unit") public void testInsertConfigMethod() { String suiteName = "sample-suite"; String testName = "sample-test"; String packageName = "sample-package"; String className = "sample-class"; JsonRuntimeReporterHelper helper = new JsonRuntimeReporterHelper(); ITestResult result = Reporter.getCurrentTestResult(); helper.insertConfigMethod(suiteName, testName, packageName, className, result); result.setStatus(1); helper.insertConfigMethod(suiteName, testName, packageName, className, result); JsonArray jsonArray = helper.getCompletedConfigContent(); assertEquals(jsonArray.size(), 1); JsonObject jsonObject = (JsonObject) jsonArray.get(0); assertEquals(jsonObject.get("suite").getAsString(), suiteName); assertEquals(jsonObject.get("test").getAsString(), testName); assertEquals(jsonObject.get("packageInfo").getAsString(), packageName); assertEquals(jsonObject.get("className").getAsString(), className); assertEquals(jsonObject.get("status").getAsString(), "Passed"); }