public void addListener(T listener){
  if (listener == null) {
    throw new NullPointerException();
  }
  listeners.add(listener);
}

public void addListener ( T listener ) { if ( listener == null ) { throw new NullPointerException ( ) ; } listeners . add ( listener ) ; }
registers a listener to receive events .
