title: Prohibit direct extension of Java class outside its package
body: <p>I have a package with a</p>
  
  <pre><code>public abstract class Player { /*...*/ }
  </code></pre>
  
  <p>and these</p>
  
  <pre><code>public abstract class GamePlayer extends Player { /*...*/ }
  public abstract class TournamentPlayer extends Player { /*...*/ }
  public abstract class StatelessPlayer extends Player { /*...*/ }
  </code></pre>
  
  <p>Users of the package need Players but in order to use the package without breaking it I require that they never <em>directly</em> extend Player.  Instead they should extend one of the subclasses provided.</p>
  
  <p>Question: How should I prevent users from extending Player directly?</p>
  
  <p>I'm looking for a way that makes it obvious that this prohibition is intended.</p>