title: Get rid of Unchecked overriding: return type requires unchecked conversion
body: <p>Example code similar to my code.</p>
  
  <pre><code>public interface Builder&lt;B, A&gt; {
    B build(A a);
  }
  
  public class ClientBuilder implements Builder&lt;String, Integer&gt; {
    @Override
    public String build(Integer i) {
      return i.toString();
    }
  }
  
  public abstract class Client&lt;B&gt; {
    protected abstract &lt;A&gt; Builder&lt;B, A&gt; getBuilder();
  }
  
  public class ClientClient extends Client&lt;String&gt; {
  
    @Override
    protected Builder&lt;String, Integer&gt; getBuilder() {
      return null;
    }
  }
  </code></pre>
  
  <p>In my <code>ClientClient</code> class I get a warning that says the following:</p>
  
  <p><code>Unchecked overriding: return type requires unchecked conversion.Found 'Builder&lt;java.lang.String,java.lang.Integer&gt;', required 'Builder&lt;java.lang.String,A&gt;</code></p>
  
  <p>Is there something I can do to get rid of this error?<br>
  I could use <code>@SuppressWarnings("unchecked")</code>, but that doesn't feel right.</p>
  
  <p>In my example <code>A</code> is always an <code>Integer</code> but in my real code <code>A</code> can be one of two objects.</p>
  
  <p>I guess I could also have two methods in my interface like this:</p>
  
  <pre><code>public interface Builder&lt;B&gt; {
    B build(Integer i);
    B build(String s);
  }
  </code></pre>