code: private MethodMetadata<?, ?> createResultOfMetadata(AnnotatedMethod annotatedMethod, ResultOf resultOf) {
          Method method = annotatedMethod.getAnnotatedElement();
  
          // Determine query type
          Class<?> methodReturnType = method.getReturnType();
          Class<?> returnType;
          if (Result.class.isAssignableFrom(methodReturnType)) {
              Type genericReturnType = method.getGenericReturnType();
              ParameterizedType parameterizedType = (ParameterizedType) genericReturnType;
              returnType = (Class<?>) parameterizedType.getActualTypeArguments()[0];
          } else {
              returnType = methodReturnType;
          }
  
          // Determine query type
          AnnotatedElement query = resultOf.query();
          if (Object.class.equals(query)) {
              if (annotatedMethod.getByMetaAnnotation(QueryDefinition.class) != null) {
                  query = annotatedMethod.getAnnotatedElement();
              } else {
                  query = returnType;
              }
          }
          // Determine parameter bindings
          Annotation[][] parameterAnnotations = method.getParameterAnnotations();
          List<Parameter> parameters = new ArrayList<>();
          for (Annotation[] parameterAnnotation : parameterAnnotations) {
              Parameter parameter = null;
              for (Annotation annotation : parameterAnnotation) {
                  if (Parameter.class.equals(annotation.annotationType())) {
                      parameter = (Parameter) annotation;
                  }
              }
              if (parameter == null) {
                  throw new XOException("Cannot determine parameter names for '" + method.getName() + "', all parameters must be annotated with '"
                          + Parameter.class.getName() + "'.");
              }
              parameters.add(parameter);
          }
          boolean singleResult = !Iterable.class.isAssignableFrom(methodReturnType);
          return new ResultOfMethodMetadata<>(annotatedMethod, query, returnType, resultOf.usingThisAs(), parameters, singleResult);
      }
docs: Creates the method metadata for methods annotated with {@link ResultOf}.
  
  @param annotatedMethod
  The annotated method-
  @param resultOf
  The {@link com.buschmais.xo.api.annotation.ResultOf} annotation.
  @return The method metadata.