public void execute(final Scheduler scheduler, final Consumer<T> action) {
        if (action == null) {
            return;
        }
        lock.readLock().lock();
        try {
            for (T listener : listeners.values()) {
                if (scheduler != null) {
                    scheduler.createWorker().schedule(() -> action.accept(listener));
                } else {
                    action.accept(listener);
                }
            }
        } finally {
            lock.readLock().unlock();
        }
    }
Helper class for those classes that provide listener concepts. Manages a bunch of listeners.
main/src/main/java/cgeo/geocaching/utils/ListenerHelper.java