title: Force a class in Java to call a method
body: <p>I have a class which holds a private member (which itself is an object). I want to access the member in a legitimate way and modify its properties. The way I thought of doing this is to make the class call a method of my class (where I want to access it) with its private member.</p>
  
  <p>For example, I have class <code>ClassA</code> which has property <code>mItem</code>. I want to get the instance of <code>mItem</code> in <code>ClassB</code> so that I can call <code>mItem.update()</code> at a later point of time (when user updates something on UI). From <code>ClassB</code>, I want to call a method of <code>ClassA</code> (say, <code>passItem</code>) that actually calls some method (say, <code>obtainItem(Item item)</code>) of <code>ClassB</code> passing <code>mItem</code>. However, I want to enforce this, so that <code>passItem</code> implementation mandates calling <code>obtainItem</code> of <code>ClassB</code> with <code>mItem</code>.</p>
  
  <p>Any ideas?</p>