private static <K, V> void withAssertions( FunctionalListeners<K, V> listeners, Runnable r, Consumer<FunctionalListenerAssertions<K, V>> c) { try (FunctionalListenerAssertions<K, V> a = FunctionalListenerAssertions.create(listeners, r)) { c.accept(a); } }
private static <K, V> void withAssertions( ConcurrentMap<K, V> map, Runnable r, Consumer<FunctionalListenerAssertions<K, V>> c) { try (FunctionalListenerAssertions<K, V> a = FunctionalListenerAssertions.create(map, r)) { c.accept(a); } }