code: private static Object createIntermediate(Object target, StringBuffer pathSofar, String index,
              String nextIndex) {
          if (target instanceof JsonNode) {
              return createIntermediate((JsonNode) target, pathSofar, index, nextIndex);
          }
          Object value = PATTERN_INDEX.matcher(nextIndex).matches() ? new ArrayList<Object>()
                  : new HashMap<String, Object>();
          return createIntermediate(target, pathSofar, index, value);
      }
docs: /*----------------------------------------------------------------------