public void removeListener(T listener){
  if (listeners != null) {
    List<T> newlisteners=new ArrayList<T>();
    newlisteners.addAll(listeners);
    newlisteners.remove(listener);
    listeners=newlisteners;
  }
}

public void removeListener ( T listener ) { if ( listeners != null ) { List < T > newlisteners = new ArrayList < T > ( ) ; newlisteners . addAll ( listeners ) ; newlisteners . remove ( listener ) ; listeners = newlisteners ; } }
remove the given listener
