Do Java listeners need to be removed? (In general)
<p>Imagine this sample java class:</p>

<pre><code>class A {
    void addListener(Listener obj);
    void removeListener(Listener obj);
}

class B {
    private A a;
    B() {
        a = new A();
        a.addListener(new Listener() {
            void listen() {}
        }
 }
</code></pre>

<p>Do I need to add a finalize method to B to call a.removeListener?  Assume that the A instance will be shared with some other objects as well and will outlive the B instance.</p>

<p>I am worried that I might be creating a garbage collector problem here.  What is the best practice?</p>
