 <p>Do you want to re-write the handler using lambda's? Could be something like the following</p> <pre><code>&lt;T&gt; MessageConsumer&lt;T&gt; consumer(String address, Function&lt;Message&lt;T&gt;, Void&gt; function); </code></pre> <p>and instead of</p> <pre><code>doSomething.consumer("someString", new Handler&lt;Message&lt;JsonObject&gt;&gt;() { @Override public void handle(Message&lt;JsonObject&gt; event) { //do some code } }); </code></pre> <p>you could write</p> <pre><code>doSomething.consumer("someString", message -&gt; null); </code></pre>