title: Make Java parent class not part of the interface
body: <p>(This is a hypothetical question for discussion, I have no actual problem).</p>
  
  <p>Say that I'm making an implementation of <code>SortedSet</code> by extending <code>LinkedHashMap</code>:</p>
  
  <pre><code>class LinkedHashSortedMapThing extends LinkedHashMap implements SortedSet {
   ...
  }
  </code></pre>
  
  <p>Now programmers who use this class may do</p>
  
  <pre><code>LinkedHashMap x = new LinkedHashSortedMapThing();
  </code></pre>
  
  <p>But what if I consider the extending of <code>LinkedHashMap</code> an implementation detail, and do not want it to be a part of the class' contract? If people use the line above, I can no longer freely change this detail without worrying about breaking existing code.
  Is there any way to prevent this sort of thing, other than favouring composition over inheritance (which is not always possible due to private/protected members)?</p>