### Question:
JsonUtils { public static String getJsonRootProperty(String jsonStr) throws JSONException { Iterator<String> iter = getJsonIterator(jsonStr); if (!iter.hasNext()) { throw new JSONException("Empty JSON object"); } String rootPropertyName = iter.next(); if (iter.hasNext()) { throw new JSONException("JSON object has more than one root property"); } return rootPropertyName; }  static String xml2json(String xml, Boolean pretty); static String xml2json(String xml); static String json2xml(String jsonStr, Boolean pretty); static String toXMLString(Object obj, String tagName); static String json2xml(String jsonStr); static String prettyJson(String jsonStr); static Iterator<String> getJsonIterator(String jsonStr); static String getJsonRootProperty(String jsonStr); static String getJsonValue(String jsonStr, String keys); static String getJsonNodeValue(String jsonStr, String keys); static int getJsonIntValue(String jsonStr, String keys); static boolean getJsonBooleanValue(String jsonStr, String keys); static String getJsonParamValue(String jsonStr, String keys, String name); static String getJsonParamValue(String jsonStr, String keys, String name, int index); static String getJsonValueForKey(String jsonStr, String key); static String getJsonValueForKey(JSONObject jsonObj, String key); static Integer getJsonIntValueForKey(JSONObject jsonObj, String key); static Boolean getJsonBooleanValueForKey(JSONObject jsonObj, String key); static Boolean jsonValueExists(String jsonStr, String keys); static String addJsonValue(String jsonStr, String keys, String value); static String updJsonValue(String jsonStr, String keys, String newValue); static String delJsonValue(String jsonStr, String keys); Map<String, String> jsonStringToMap(DelegateExecution execution, String entry); Map<String, String> entryArrayToMap(DelegateExecution execution, String entryArray, String keyNode,
            String valueNode); Map<String, String> entryArrayToMap(String entryArray, String keyNode, String valueNode); List<String> StringArrayToList(Execution execution, String jsonArray); List<String> StringArrayToList(String jsonArray); List<String> StringArrayToList(JSONArray jsonArray); static boolean jsonElementExist(String jsonStr, String keys); static String jsonSchemaValidation(String jsonStr, String jsonSchemaPath);  }### Answer:
@Test public void getJsonRootPropertyTest() throws IOException { String response = this.getJson("SDNCServiceResponseExample.json"); assertEquals("SDNCServiceResponse", JsonUtils.getJsonRootProperty(response)); }
@Test public void getJsonRootProperty_ExceptionTest() throws IOException { expectedException.expect(JSONException.class); String response = this.getJson("SNIROExample.json"); String root = JsonUtils.getJsonRootProperty(response); }