in invoker/core/src/main/java/com/google/cloud/functions/invoker/TypedFunctionExecutor.java [87:93]
static Optional<Type> handlerTypeArgument(Class<? extends TypedFunction<?, ?>> functionClass) {
return Arrays.stream(functionClass.getMethods())
.filter(method -> method.getName().equals(APPLY_METHOD) && method.getParameterCount() == 1)
.map(method -> method.getGenericParameterTypes()[0])
.filter(type -> type != Object.class)
.findFirst();
}