public void addControllerListener(ControllerInterface listener){
  if (controllerListeners == null) {
    controllerListeners=new ArrayList<ControllerInterface>(1);
  }
  if (!controllerListeners.contains(listener)) {
    controllerListeners.add(listener);
  }
}

public void addControllerListener ( ControllerInterface listener ) { if ( controllerListeners == null ) { controllerListeners = new ArrayList < ControllerInterface > ( 1 ) ; } if ( ! controllerListeners . contains ( listener ) ) { controllerListeners . add ( listener ) ; } }
add a listener to handle : listener . sendpackettodevice ( message ) ;
