code: public JsonNode evaluate(final JsonNode document) throws JsonPointerEvaluationException {
          JsonNode current = document;
  
          for (int idx = 0; idx < tokens.length; ++idx) {
              final RefToken token = tokens[idx];
  
              if (current.isArray()) {
                  if (!token.isArrayIndex())
                      error(idx, "Can't reference field \"" + token.getField() + "\" on array", document);
                  if (token.getIndex() == LAST_INDEX || token.getIndex() >= current.size())
                      error(idx, "Array index " + token.toString() + " is out of bounds", document);
                  current = current.get(token.getIndex());
              }
              else if (current.isObject()) {
                  if (!current.has(token.getField()))
                      error(idx,"Missing field \"" + token.getField() + "\"", document);
                  current = current.get(token.getField());
              }
              else
                  error(idx, "Can't reference past scalar value", document);
          }
  
          return current;
      }
docs: Takes a target document and resolves the node represented by this instance.
  
  The evaluation semantics are described in
  <a href="https://tools.ietf.org/html/rfc6901#section-4">RFC 6901 sectino 4</a>.
  
  @param document The target document against which to evaluate the JSON pointer.
  @return The {@link JsonNode} resolved by evaluating this JSON pointer.
  @throws JsonPointerEvaluationException The pointer could not be evaluated.