### Question:
PluginManagerUtils { public static String removePossibleWrapperText(String urlText) { if (urlText != null && urlText.startsWith("updateCenter.post(")) { Pattern pattern = Pattern.compile("updateCenter.post\\((.*)\\);", Pattern.DOTALL); Matcher matcher = pattern.matcher(urlText); if (matcher.find()) { return matcher.group(1); } } return urlText; } private  PluginManagerUtils(); static String appendPathOntoUrl(Object urlString, Object... pathSection); static String appendPathOntoUrl(String urlString, String... pathSection); static String removePossibleWrapperText(String urlText); static String dirName(Object urlString); static String dirName(String urlString); static String removePath(Object urlString); static String removePath(String urlString);  }### Answer:
@Test public void removeWrapperTest() { String json = "{'json':'content', 'here':true}"; String noActual = "updateCenter.post(" + json + ");"; String result = PluginManagerUtils.removePossibleWrapperText(noActual); assertThat(result).isEqualTo(json); new JSONObject(result); }
@Test public void removeWrapperWithNoWrapperTest() { String json = "{'json':'content', 'here':true}"; String result = PluginManagerUtils.removePossibleWrapperText(json); assertThat(result).isEqualTo(json); new JSONObject(result); }
@Test public void removeWrapperWithTrailingNewLineTest() { String json = "{'json':'content', 'here':true}"; String noActual = "updateCenter.post(" + json + ");\n"; String result = PluginManagerUtils.removePossibleWrapperText(noActual); assertThat(result).isEqualTo(json); new JSONObject(result); }
@Test public void removeWrapperWithInternalNewLinesTest() { String json = "\n" + "{\n" + "'json':'content',\n" + "'here':true\n" + "}\n"; String noActual = "updateCenter.post(" + json + ");"; String result = PluginManagerUtils.removePossibleWrapperText(noActual); assertThat(result).isEqualTo(json); new JSONObject(result); }