docs: @SuppressWarnings("unchecked")
    <T> T parse(Class<T> clazz) throws JsonParserException {
      advanceToken();
      Object parsed = currentValue();
      if (advanceToken() != Token.EOF)
        throw createParseException(null, "Expected end of input, got " + token, true);
      if (clazz != Object.class && (parsed == null || clazz != parsed.getClass()))
        throw createParseException(null, "JSON did not contain the correct type, expected " + clazz.getName()
            + ".", true);
      return (T)(parsed);
    }