title: Cloning with generics
body: <p>Once upon a time there was a class:</p>
  
  <pre><code>public class Scope&lt;C extends Cloneable &amp; Comparable&lt;C&gt;&gt; implements Comparable&lt;Scope&lt;C&gt;&gt;, Cloneable, Serializable {
  
     private C starts;
     private C ends;
     ...
  
     @SuppressWarnings("unchecked")
     @Override
     public Object clone() {
         Scope&lt;C&gt; scope;
         try {
             scope = (Scope&lt;C&gt;) super.clone();
             scope.setStarts((C) starts.clone()); // The method clone() from the type Object is not visible
             scope.setEnds((C) ends.clone()); // The method clone() from the type Object is not visible
         } catch (CloneNotSupportedException e) {
             throw new RuntimeException("Clone not supported");
         }
         return scope;
     }
  }
  </code></pre>
  
  <p>In Object we have:</p>
  
  <pre><code>protected native Object clone() throws CloneNotSupportedException;
  </code></pre>
  
  <p>And Cloneable interface is:</p>
  
  <pre><code>public interface Cloneable { 
  }
  </code></pre>
  
  <p>How should I clone this?</p>