private static void addListenersForReal(final Service service,final Set<Listener> existingListeners,final Listener listener,final Executor executor){
  if (!existingListeners.contains(listener)) {
    existingListeners.add(listener);
    service.addListener(listener,executor);
  }
}

private static void addListenersForReal ( final Service service , final Set < Listener > existingListeners , final Listener listener , final Executor executor ) { if ( ! existingListeners . contains ( listener ) ) { existingListeners . add ( listener ) ; service . addListener ( listener , executor ) ; } }
adds the given listener to the service . if the service already contains the given listener it wont be added again .
