static ResultReturner forMethod(Class<?> extensionType, Method method) {
        Type returnType = GenericTypes.resolveType(method.getGenericReturnType(), extensionType);
        QualifiedType<?> qualifiedReturnType = QualifiedType.of(returnType).withAnnotations(new Qualifiers().findFor(method));
        Class<?> returnClass = GenericTypes.getErasedType(returnType);
        if (Void.TYPE.equals(returnClass)) {
            // void types may contain a Consumer argument
            return findConsumerArgument(method)
                .orElseThrow(() -> new IllegalStateException(format(
                    "Method %s#%s is annotated as if it should return a value, but the method is void.",
                    method.getDeclaringClass().getName(),
                    method.getName())));
        } else if (ResultIterable.class.equals(returnClass)) {
            return new ResultIterableReturner(qualifiedReturnType);
        } else if (Stream.class.equals(returnClass)) {
            return new StreamReturner(qualifiedReturnType);
        } else if (ResultIterator.class.equals(returnClass)) {
            return new ResultIteratorReturner(qualifiedReturnType);
        } else if (Iterator.class.equals(returnClass)) {
            return new IteratorReturner(qualifiedReturnType);
        } else if (method.isAnnotationPresent(SingleValue.class)) {
            return new SingleValueReturner<>(qualifiedReturnType);
        } else {
            // do a quick check whether a function argument is present
            return findFunctionArgument(returnType, method)
                .orElseGet(() -> new CollectedResultReturner<>(qualifiedReturnType));
        }
    }
Inspect a Method for its return type, and choose a ResultReturner subclass
that handles any container that might wrap the results.

@param extensionType the type that owns the Method
@param method        the method whose return type chooses the ResultReturner
@return an instance that takes a ResultIterable and constructs the return value. Never null.
sqlobject/src/main/java/org/jdbi/v3/sqlobject/statement/internal/ResultReturner.java