public @Nullable JsonValue resolve() {
    JsonValue root = myRoot;
    final List<JsonPointerPosition.Step> steps = JsonPointerPosition.parsePointer(myPointer).getSteps();
    for (JsonPointerPosition.Step step : steps) {
      String name = step.getName();
      if (name != null) {
        if (!(root instanceof JsonObject)) return null;
        JsonProperty property = ((JsonObject)root).findProperty(name);
        root = property == null ? null : property.getValue();
      }
      else {
        int idx = step.getIdx();
        if (idx < 0) return null;

        if (!(root instanceof JsonArray)) {
          if (root instanceof JsonObject) {
            JsonProperty property = ((JsonObject)root).findProperty(String.valueOf(idx));
            if (property == null) {
              return null;
            }
            root = property.getValue();
            continue;
          }
          else {
            return null;
          }
        }
        List<JsonValue> list = ((JsonArray)root).getValueList();
        if (idx >= list.size()) return null;
        root = list.get(idx);
      }
    }
    return root;
  }
public @Nullable JsonValue resolve()