The class HandlerStubVisitorImpl calls a HandlerRunner instance. This HandlerRunner calls the right method on the generated handler interface; in the test this is HandlerStub. The testcode tests that the return value of HandlerRunner is properly used, but the interaction between the HandlerRunner and the HandlerStub is not tested. The code suggests otherwise, because the return value is specified in the constructor of HandlerStub.