title: Ensure type safety with Java generics
body: <p>I am trying to improve the type safety of the following method:</p>
  
  <pre><code>A&lt;String&gt; method(B&lt;String&gt; arg);
  </code></pre>
  
  <p>How do I make sure that this method is not called with a raw type <code>B</code> and that compiler always checks for String type specified?</p>