code: public void setDependentListener(BaseListener dependentListener)
      {   // Set up the bi-dependecy
          BaseListener oldDependentListener = m_dependentListener;
          m_dependentListener = dependentListener;
          if (oldDependentListener != null)
          {
              if (oldDependentListener.getDependentListener() == this)
                  oldDependentListener.setDependentListener(null);    // No longer dependent on listener!
          }
          if (m_dependentListener != null)
          {
              if (m_dependentListener.getDependentListener() == null)
                  m_dependentListener.setDependentListener(this);   // Dependent on each other!
              else if (m_dependentListener.getDependentListener() != this)
              {
                  MultDepHandler multDepBehavior = new MultDepHandler(null);
                  m_dependentListener = null;
                  oldDependentListener = dependentListener.getDependentListener();
                  dependentListener.setDependentListener(null);
                  multDepBehavior.setDependentListener(dependentListener);    // Add this to the mult-dependent list
                  multDepBehavior.setDependentListener(oldDependentListener);   // Add this to the mult-dependent list
                  multDepBehavior.setDependentListener(this);   // Add this to the mult-dependent list
                  m_dependentListener = multDepBehavior;
              }
          }
      }
docs: Set a dependent listener.
  This listener is dependent on me, If I'm freed, the dependent listener is also freed.
  If there is already a dependent listener, then a three (etc) way dependency is set up.
  @param dependentListener The dependentListener to set.