code: public Object getJsonPath(String json, String jsonPath) {
          if (!JsonPath.isPathDefinite(jsonPath)) {
              throw new RuntimeException(jsonPath + " returns a list of results, not a single.");
          }
          return parseJson(json).read(jsonPath);
      }
docs: Evaluates a JsonPath expression returning a single element.
  @param json JSON value.
  @param jsonPath expression to evaluate.
  @return result result of expression.
  @throws java.lang.RuntimeException if jsonPath would return multiple elements.