title: Friend Package Pattern problems
body: <p>I came accross the friend package pattern described here:
  <a href="http://wiki.apidesign.org/wiki/APIDesignPatterns:FriendPackages" rel="nofollow noreferrer">http://wiki.apidesign.org/wiki/APIDesignPatterns:FriendPackages</a></p>
  
  <p>I simply implemented the example but it does not work for me. I always get the error</p>
  
  <pre><code>IllegalStateException: Something is wrong: null
  </code></pre>
  
  <p>The error is thrown in the Accessor class.</p>
  
  <p>The example tells that creating a new object is done by calling</p>
  
  <pre><code>Item item = Accessor.getDefault().newItem();
  </code></pre>
  
  <p>But neither Accessor.setDefault(Accessor) will be called nor the static initialization block will be called.</p>
  
  <pre><code>static {
      Accessor.setDefault(new AccessorImpl());
  }
  </code></pre>
  
  <p>How should this work?</p>