### Question:
GraphInventoryPatchConverter { protected boolean hasComplexObject(String json) { if (json.isEmpty()) { return false; } String complex = "$.*.*"; String array = "$.*.*.*"; List<String> result = JsonPathUtil.getInstance().getPathList(json, complex); List<String> result2 = JsonPathUtil.getInstance().getPathList(json, array); result.addAll(result2); return result.stream().anyMatch(item -> LOCATE_COMPLEX_OBJECT.matcher(item).find()); }  String convertPatchFormat(Object obj); String validatePatchObject(String payload);  }### Answer:
@Test public void hasComplexObjectTest() { GraphInventoryPatchConverter validator = new GraphInventoryPatchConverter(); String hasNesting = "{ \"hello\" : \"world\", \"nested\" : { \"key\" : \"value\" } }"; String noNesting = "{ \"hello\" : \"world\" }"; String arrayCase = "{ \"hello\" : \"world\", \"nestedSimple\" : [\"value1\" , \"value2\"], \"nestedComplex\" : [{\"key\" : \"value\"}]}"; String empty = "{}"; String arrayCaseSimpleOnly = "{ \"hello\" : \"world\", \"nestedSimple\" : [\"value1\" , \"value2\"]}"; String relationshipListCaseNesting = "{ \"hello\" : \"world\", \"nestedSimple\" : [\"value1\" , \"value2\"], \"relationship-list\" : [{\"key\" : \"value\"}], \"nested\" : { \"key\" : \"value\" }}"; String relationshipListCase = "{ \"hello\" : \"world\", \"nestedSimple\" : [\"value1\" , \"value2\"], \"relationship-list\" : [{\"key\" : \"value\"}]}"; String nothing = ""; assertTrue("expect has nesting", validator.hasComplexObject(hasNesting)); assertFalse("expect no nesting", validator.hasComplexObject(noNesting)); assertTrue("expect has nesting", validator.hasComplexObject(arrayCase)); assertFalse("expect no nesting", validator.hasComplexObject(empty)); assertFalse("expect no nesting", validator.hasComplexObject(arrayCaseSimpleOnly)); assertFalse("expect no nesting", validator.hasComplexObject(relationshipListCase)); assertTrue("expect has nesting", validator.hasComplexObject(relationshipListCaseNesting)); assertFalse("expect no nesting", validator.hasComplexObject(nothing)); }