code: protected void addBehaviorListener(BehaviorListener listener) {
  
          if (listener == null) {
              throw new NullPointerException();
          }
          if (listeners == null) {
              //noinspection CollectionWithoutInitialCapacity
              listeners = new ArrayList<BehaviorListener>();
          }
          listeners.add(listener);
  
          clearInitialState();
      }
docs: <p class="changed_added_2_0">Add the specified {@link BehaviorListener}
  to the set of listeners registered to receive event notifications
  from this {@link Behavior}.
  It is expected that {@link Behavior} classes acting as event sources
  will have corresponding typesafe APIs for registering listeners of the
  required type, and the implementation of those registration methods
  will delegate to this method.  For example:</p>
  <pre>
  public class AjaxBehaviorEvent extends BehaviorEvent { ... }
  
  public interface AjaxBehaviorListener extends BehaviorListener {
  public void processAjaxBehavior(FooEvent event);
  }
  
  public class AjaxBehavior extends ClientBehaviorBase {
  ...
  public void addAjaxBehaviorListener(AjaxBehaviorListener listener) {
  addBehaviorListener(listener);
  }
  public void removeAjaxBehaviorListener(AjaxBehaviorListener listener) {
  removeBehaviorListener(listener);
  }
  ...
  }
  </pre>
  
  @param listener The {@link BehaviorListener} to be registered
  
  @throws NullPointerException if <code>listener</code>
  is <code>null</code>
  
  @since 2.0