@SuppressWarnings("unchecked")
@Test
public void convertObject() {

    // single level
    ObjectNode objectNode = new ObjectNode(factory);
    objectNode.put("age", "1");
    Object result = expressionEvaluatorLocal.createAndFillObject(objectNode,
                                                                 new HashMap<>(),
                                                                 Map.class.getCanonicalName(),
                                                                 Collections.singletonList(String.class.getCanonicalName()));
    assertTrue(result instanceof Map);
    Map<String, Object> resultMap = (Map<String, Object>) result;
    assertEquals("1", resultMap.get("age"));
    // nested object
    objectNode.removeAll();
    ObjectNode nestedObject = new ObjectNode(factory);
    objectNode.set("nested", nestedObject);
    nestedObject.put("field", "fieldValue");
    result = expressionEvaluatorLocal.createAndFillObject(objectNode,
                                                          new HashMap<>(),
                                                          String.class.getCanonicalName(),
                                                          emptyList());
    assertTrue(result instanceof Map);
    resultMap = (Map<String, Object>) result;
    assertEquals(1, resultMap.size());
    Map<String, Object> nested = (Map<String, Object>) resultMap.get("nested");
    assertEquals(1, nested.size());
    assertEquals("fieldValue", nested.get("field"));
    // nested list
    objectNode.removeAll();
    ArrayNode jsonNodes = new ArrayNode(factory);
    objectNode.set("listField", jsonNodes);
    jsonNodes.add(nestedObject);
    result = expressionEvaluatorLocal.createAndFillObject(objectNode,
                                                          new HashMap<>(),
                                                          String.class.getCanonicalName(),
                                                          emptyList());
    assertTrue(result instanceof Map);
    resultMap = (Map<String, Object>) result;
    assertEquals(1, resultMap.size());
    List<Map<String, Object>> nestedList = (List<Map<String, Object>>) resultMap.get("listField");
    assertEquals(1, nestedList.size());
    assertEquals("fieldValue", nestedList.get(0).get("field"));
}