you have to return a factory like this:
UnaryOperator<RestHandler> getRestHandlerWrapper(ThreadContext threadContext) {
return originalHanlder ->
(RestHandler) (request, channel, client) -> {
System.out.println("Log Something");
originalHanlder.handleRequest(request, channel, client);
};
}