public synchronized void removeDiscoveryListener(DiscoveryListener l){
  if (terminated) {
    throw new IllegalStateException("discovery terminated");
  }
  int index=listeners.indexOf(l);
  if (index != -1)   listeners.remove(index);
}

public synchronized void removeDiscoveryListener ( DiscoveryListener l ) { if ( terminated ) { throw new IllegalStateException ( "discovery terminated" ) ; } int index = listeners . indexOf ( l ) ; if ( index != - 1 ) listeners . remove ( index ) ; }
remove a discoverylistener from the listener set . it does nothing if the discoverylistener does not exist in the the listener set .
