### Question:
JsonUtils { public Map<String, String> entryArrayToMap(DelegateExecution execution, String entryArray, String keyNode, String valueNode) { logger.debug("Started Entry Array To Map Util Method"); Map<String, String> map = new HashMap<>(); String entryListJson = "{ \"wrapper\":" + entryArray + "}"; JSONObject obj = new JSONObject(entryListJson); JSONArray arr = obj.getJSONArray("wrapper"); for (int i = 0; i < arr.length(); i++) { JSONObject jo = arr.getJSONObject(i); String key = jo.getString(keyNode); String value = jo.get(valueNode).toString(); map.put(key, value); } logger.debug("Completed Entry Array To Map Util Method"); return map; }  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 entryArrayToMapTest() throws IOException { JsonUtils utils = new JsonUtils(); String response = this.getJson("SNIROExample.json"); String entry = JsonUtils.getJsonValue(response, "solutionInfo.placementInfo"); JSONArray arr = new JSONArray(entry); JSONObject homingDataJson = arr.getJSONObject(0); JSONArray assignmentInfo = homingDataJson.getJSONArray("assignmentInfo"); Map<String, String> map = utils.entryArrayToMap(execution, assignmentInfo.toString(), "variableName", "variableValue"); assertEquals(map.get("cloudOwner"), "CloudOwner"); }