I have some common logic for a couple of my handler classes that I'm trying to refactor out. Basically they need to lookup a 'user' object and pass it on to the next handler if found or return 404 if not.
I've ended up by registering handlers like this:
handler("api/:username/messages", new RequiresUserHandler(registry.get(UserStore), registry.get(MessageHandler)))
Since I'm using `RequiresUserHandler` in a couple of places and it needs a different handler passed to its 2nd constructor parameter each time it seems like I can't register it with Guice. However this looks a bit of a mess as the 1st constructor argument is always the same and I can't help thinking there must be a better way to do it.