static ResultReturner of(Method method, int consumerIndex) {
            Type parameterType = method.getGenericParameterTypes()[consumerIndex];
            QualifiedType<?> elementType = QualifiedType.of(
                GenericTypes.findGenericParameter(parameterType, Consumer.class)
                    .orElseThrow(() -> new IllegalStateException(
                        format("Cannot reflect Consumer<T> element type T in method consumer parameter '%s'", parameterType))))
                .withAnnotations(new Qualifiers().findFor(method.getParameters()[consumerIndex]));

            Type type = elementType.getType();

            if (GenericTypes.isSuperType(Iterator.class, type)) {
                // special case: Consumer<Iterator<T>>
                if (GenericTypes.getErasedType(type) == Iterator.class) {
                    return getIteratorConsumer(consumerIndex, elementType.mapType(t -> GenericTypes.findGenericParameter(t, Iterator.class)
                        .orElseThrow(() -> new IllegalStateException(format("Couldn't find Iterator type on '%s'", elementType)))));
                }
                throw new IllegalArgumentException(format("Consumer argument for %s can not use subtype '%s' of Iterator!", method, type));

            } else if (GenericTypes.isSuperType(Stream.class, type)) {
                // special case: Consumer<Stream<T>>
                if (GenericTypes.getErasedType(type) == Stream.class) {
                    return getStreamConsumer(consumerIndex, elementType.mapType(t -> GenericTypes.findGenericParameter(t, Stream.class)
                        .orElseThrow(() -> new IllegalStateException(format("Couldn't find Stream type on '%s'", elementType)))));
                }
                throw new IllegalArgumentException(format("Consumer argument for %s can not use subtype '%s' of Stream!", method, type));

            } else if (GenericTypes.isSuperType(Iterable.class, type)) {
                // special case: Consumer<Iterable<T>>
                if (GenericTypes.getErasedType(type) == Iterable.class) {
                    return getIterableConsumer(consumerIndex, elementType.mapType(t -> GenericTypes.findGenericParameter(t, Iterable.class)
                        .orElseThrow(() -> new IllegalStateException(format("Couldn't find Iterable type on '%s'", elementType)))));
                }
                throw new IllegalArgumentException(format("Consumer argument for %s can not use subtype '%s' of Iterable!", method, type));

            } else {
                // everything else is per-row Consumer<T>
                return getEachConsumer(consumerIndex, elementType);
            }
        }
Inspect a Method for a {@link Consumer} to execute for each produced row.

@param method the method called
@return a ResultReturner that invokes the consumer and does not return a value
sqlobject/src/main/java/org/jdbi/v3/sqlobject/statement/internal/ResultReturner.java