### Question:
JSONUtils { public void remove(JsonNode jsonNode, String path) { JsonPointer valueNodePointer = JsonPointer.compile(asJsonPath(path)); JsonPointer parentPointer = valueNodePointer.head(); JsonNode parentNode = jsonNode.at(parentPointer); if (parentNode.getNodeType() == JsonNodeType.OBJECT) { ObjectNode parentNodeToUpdate = (ObjectNode) parentNode; parentNodeToUpdate.remove(StringUtils.replace(valueNodePointer.last().toString(),"/","")); } } private  JSONUtils(); static JSONUtils getInstance(); JsonNode parse(String raw); JsonNode parseWithError(String raw); ObjectNode parseObj(String raw); String asJsonString(T object); T parse(byte[] raw, Class<T> destClass); T parse(String raw, Class<T> destClass); JsonNode toJsonNode(Object obj); String asJsonPath(String path); boolean has(JsonNode jsonNode, String path); JsonNode at(JsonNode jsonNode, String path); void put(JsonNode jsonNode, String path, JsonNode value); void remove(JsonNode jsonNode, String path);  }### Answer:
@Test public void remove() { String input = "{\n" + " \"name\":\"John\",\n" + " \"age\":30,\n" + " \"cars\": {\n" + " \"car1\":\"Ford\",\n" + " \"car2\":\"BMW\",\n" + " \"car3\":\"Fiat\"\n" + " }\n" + " }"; JsonNode parse = jsonUtils.parse(input); jsonUtils.remove(parse, "age"); Assertions.assertThat(parse.at("/age").getNodeType()).isEqualTo(JsonNodeType.MISSING); jsonUtils.remove(parse, "cars.car3"); Assertions.assertThat(parse.at("/cars/cars3").getNodeType()).isEqualTo(JsonNodeType.MISSING); }