private static Type getActualReturnType(Method method) {
        final Class<?> returnType;
        final Type genericReturnType;

        if (KotlinUtil.isKFunction(method)) {
            returnType = KotlinUtil.kFunctionReturnType(method);
            if (KotlinUtil.isReturnTypeNothing(method)) {
                genericReturnType = KotlinUtil.kFunctionReturnType(method);
            } else {
                genericReturnType = KotlinUtil.kFunctionGenericReturnType(method);
            }
        } else {
            returnType = method.getReturnType();
            genericReturnType = method.getGenericReturnType();
        }

        if (HttpResult.class.isAssignableFrom(returnType) ||
            ResponseEntity.class.isAssignableFrom(returnType)) {
            final ParameterizedType type = (ParameterizedType) genericReturnType;
            warnIfHttpResponseArgumentExists(type, type, returnType);
            return type.getActualTypeArguments()[0];
        } else {
            return genericReturnType;
        }
    }
An {@link HttpService} which is defined by a {@link Path} or HTTP method annotations.
This class is not supposed to be instantiated by a user. Please check out the documentation
<a href="https://armeria.dev/docs/server-annotated-service">Annotated HTTP Service</a> to use this.
core/src/main/java/com/linecorp/armeria/internal/server/annotation/DefaultAnnotatedService.java