code: public static <T> Middleware<AsyncHandler<T>, AsyncHandler<Response<ByteString>>> htmlSerialize(
        final String templateName) {
      return handler ->
          requestContext -> handler.invoke(requestContext)
              .thenApply(result -> Response
                  .forPayload(serialize(templateName, result))
                  .withHeader(CONTENT_TYPE, HTML));
    }
docs: Async middleware for POJO.
  
  @param templateName The template name, respective to the "resources" folder
  @param <T>          The Type of the parameters
  @return the middlware