title: 2 way coupling of generics in java
body: <p>sorry about the title I couldn't explain it in one sentence better!</p>
  
  <p>so here is the problem, I'm making a small Card games engine in java, I'm trying to define the interfaces for the games to be as generic as possible</p>
  
  <p>so I have these interfaces</p>
  
  <pre><code>public interface Card
  {
       //some methods
  }
  public interface CardGame&lt;TCard extends Card,TPlayer extends Player&gt;
  {
       //example method
       TPlayer getPlayerByName(String name);
  }
  public interface Player&lt;TCardGame extends CardGame&gt;
  {
       //HERE IS THE ISSUE
       List&lt;TCard&gt; getCards();
  }
  </code></pre>
  
  <p>the issue is in the last interface, I want to force a player to return the same type of cards of the game that is he is a generic of</p>
  
  <p>in other words, <code>Player&lt;BannaCardGame&gt;</code> , should have <code>List&lt;BananCards&gt;</code></p>
  
  <p>but I can't find the right syntax to do this, TCard inside the Player interface has no meaning</p>
  
  <p>so how can I achieve this behaviour ?</p>