title: generics compilation error: type argument is not within bounds of type-variable S
body: <p>Here's a simplified version of the object model that I am working on. </p>
  
  <pre><code>public class GenericsTest {
      public interface FooInterface {
          public void foo();
      }
      public class Bar implements FooInterface {
          public void foo() {}
      }
      public interface GenericInterface &lt;T&gt; {
          public T func1();
      }
      public class Service implements GenericInterface&lt;Bar&gt; {
          @Override
          public Bar func1() {
              return null;
          }
      }
      public class GenericBar &lt;S extends GenericInterface&lt;FooInterface&gt;&gt; {
          public S s;
          public GenericBar() {}
      }
  
      public static void main(String[] args) {
          GenericBar&lt;Service&gt; serviceGenericBar;  // &lt;-- compilation error at this line
  
        &lt;... more code ...&gt;
      }
  
  }
  </code></pre>
  
  <p>Compiler Error: <code>type argument GenericsTest.Service is not within bounds of type-variable S</code></p>
  
  <p>IDE (intellij) shows some more details on the error: <code>Type parameter 'GenericsTest.Service' is not within its bound; should implement GenericsTest.GenericInterface&lt;GenericTests.FooInterface&gt;</code></p>
  
  <p><code>Service</code> class is implementing the GenericInterface. I have looked at few other SO questions with the same error but they don't offer clues for this particular scenario. Any ideas on how to fix this?</p>