 by subclassing with anonymous class
      jsonbConfig.withAdapters(new JsonbAdapter&lt;Box&lt;Integer&gt;, Crate&lt;String&gt;&gt; {...});
 </code>
 </pre>

 <p>Sample 2:</p>
 <pre>
 <code>
      BoxToCrateAdapter&lt;T&gt; implements JsonbAdapter&lt;Box&lt;T&gt;, Integer&gt; {...};

      // Bad way: Generic type information is lost due to type erasure
      jsonbConfig.withAdapters(new BoxToCrateAdapter&lt;Integer&gt;());

      // Proper way: Anonymous class holds generic type information
      jsonbConf