title: Java generics - method parameter
body: <p>Is it necessary to parametrize the entire interface for this scenario, even though Bar is only being used in a single method?</p>
  
  <pre><code>public interface IFoo&lt;T&gt;{
  
      void method1(Bar&lt;T&gt; bar);
  
      //Many other methods that don't use Bar....
  
  }  
  
  public class Foo1 implements IFoo&lt;Yellow&gt;{
  
      void method1(Bar&lt;Yellow&gt; bar){...};
  
      //Many other methods that don't use Bar....
  
  }
  
  
  public class Foo2 implements IFoo&lt;Green&gt;{
  
      void method1(Bar&lt;Green&gt; bar){...};
  
      //Many other methods that don't use Bar....
  
  }
  </code></pre>