mvvmfx-utils/src/main/java/de/saxsys/mvvmfx/utils/listener/ListenerManager.java
private <T, U> void clearMap(Map<T, Set<U>> map, BiConsumer<T, U> consumer) {
		for (T observable : map.keySet()) {
			for (U listener : map.get(observable)) {
				consumer.accept(observable, listener);
			}
		}
		map.clear();
	}
private <T, U> void clearMap(Map<T, Set<U>> map, BiConsumer<T, U> consumer) {
		for (T observable : map.keySet()) {
			for (U listener : map.get(observable)) {
				consumer.accept(observable, listener);
			}
		}
		map.clear();
	}
private < T , U > void clearMap ( Map < T , Set < U > > map , BiConsumer < T , U > consumer ) { for ( T observable : map . keySet ( ) ) { for ( U listener : map . get ( observable ) ) { consumer . accept ( observable , listener ) ; } } map . clear ( ) ; }
This method is used to clear the given map. To do this you need to implement a BiConsumer that calls the specific
method to remove a listener from an observable.

This needs to be done as there is no common interface with a remove method that all types of observables are
implementing. Therefore the method call to the specific removeListener method needs to be done in an extra
function.

@param map
the multimap that contains the observables and listeners.
@param consumer
a function that calls the specific remove method for the given types.
This method is used to clear the given map . To do this you need to implement a BiConsumer that calls the specific method to remove a listener from an observable .