title: Recursive type parameters for an almost-cyclic type bound
body: <p>I have the following two interfaces:</p>
  
  <pre><code>/**
   * A marker interface to denote that an object implements a view on some other object.
   *
   * @param &lt;T&gt;   The type of object that is viewed
   */
  public interface View&lt;T extends Viewable&lt;View&lt;T&gt;&gt;&gt; {
  
  }
  </code></pre>
  
  <hr>
  
  <pre><code>/**
   * An interface for objects that are viewable via a view.
   * 
   * @param &lt;T&gt;   The type of viewable object
   */
  public interface Viewable&lt;T extends View&lt;?&gt;&gt; {
      public void addViewCallback(final T view);
  
      public void removeViewCallback(final T view);
  }
  </code></pre>
  
  <p>I want to enforce the following:</p>
  
  <ul>
  <li>The type parameter of the <code>View</code> (called (a)), should be a <code>Viewable</code> that views upon that view (a).</li>
  <li>The type parameter of <code>Viewable</code> (called (b)), should be a <code>View</code>, which is viewable via that same viewable (b).</li>
  </ul>
  
  <p>I think I got the bounds done for <code>View</code>, but how am I going to make them work for <code>Viewable</code>? What I got now compiles, but does not offer enough protection.</p>
  
  <p>I cannot, as of now, formulate something that gets accepted which I do not want, I can however formulate what I <em>do</em> want, if that helps:</p>
  
  <ul>
  <li><code>public class Hand implements Viewable&lt;HandView&gt;</code></li>
  <li><code>public interface HandView extends View&lt;Hand&gt;</code></li>
  </ul>