@Test public void testMissing() { try { ExtensionAdderProviders.findCachedProvider("Default", SimpleExtensionAdder.class, new ConcurrentHashMap<>(), new ConcurrentHashMap<>()); fail("Should throw Missing Provider exception"); } catch (PowsyblException e) { assertTrue("Should throw Missing Provider exception", e.getMessage().contains("not found")); } }
static <O, E extends Extension<O>, B extends ExtensionAdder<O, E>> ExtensionAdderProvider findCachedProvider( String name, Class<B> type, ConcurrentMap<String, List<ExtensionAdderProvider>> providersMap, ConcurrentMap<Pair<String, Class>, ExtensionAdderProvider> cache) { return cache.computeIfAbsent(Pair.of(name, type), k -> findProvider(name, type, providersMap)); }
ExtensionAdderProviders { static <O, E extends Extension<O>, B extends ExtensionAdder<O, E>> ExtensionAdderProvider findCachedProvider( String name, Class<B> type, ConcurrentMap<String, List<ExtensionAdderProvider>> providersMap, ConcurrentMap<Pair<String, Class>, ExtensionAdderProvider> cache) { return cache.computeIfAbsent(Pair.of(name, type), k -> findProvider(name, type, providersMap)); } }
ExtensionAdderProviders { static <O, E extends Extension<O>, B extends ExtensionAdder<O, E>> ExtensionAdderProvider findCachedProvider( String name, Class<B> type, ConcurrentMap<String, List<ExtensionAdderProvider>> providersMap, ConcurrentMap<Pair<String, Class>, ExtensionAdderProvider> cache) { return cache.computeIfAbsent(Pair.of(name, type), k -> findProvider(name, type, providersMap)); } private  ExtensionAdderProviders(); }
ExtensionAdderProviders { static <O, E extends Extension<O>, B extends ExtensionAdder<O, E>> ExtensionAdderProvider findCachedProvider( String name, Class<B> type, ConcurrentMap<String, List<ExtensionAdderProvider>> providersMap, ConcurrentMap<Pair<String, Class>, ExtensionAdderProvider> cache) { return cache.computeIfAbsent(Pair.of(name, type), k -> findProvider(name, type, providersMap)); } private  ExtensionAdderProviders(); static ExtensionAdderProvider findCachedProvider(
            String name, Class<B> type); }
ExtensionAdderProviders { static <O, E extends Extension<O>, B extends ExtensionAdder<O, E>> ExtensionAdderProvider findCachedProvider( String name, Class<B> type, ConcurrentMap<String, List<ExtensionAdderProvider>> providersMap, ConcurrentMap<Pair<String, Class>, ExtensionAdderProvider> cache) { return cache.computeIfAbsent(Pair.of(name, type), k -> findProvider(name, type, providersMap)); } private  ExtensionAdderProviders(); static ExtensionAdderProvider findCachedProvider(
            String name, Class<B> type);  }