@Test public void loadOK() { Loader loader = LoaderHelper.getLoader("test"); assertTrue(loader instanceof LoaderImpl); assertEquals("test", loader.key()); }
public static Loader getLoader(final String key) { for (final Loader loader : ServiceLoader.load(Loader.class)) { if (key.equals(loader.key())) { return loader; } } throw new DiagramGeneratorRuntimeException("no loader found for key " + key, null); }
LoaderHelper { public static Loader getLoader(final String key) { for (final Loader loader : ServiceLoader.load(Loader.class)) { if (key.equals(loader.key())) { return loader; } } throw new DiagramGeneratorRuntimeException("no loader found for key " + key, null); } }
LoaderHelper { public static Loader getLoader(final String key) { for (final Loader loader : ServiceLoader.load(Loader.class)) { if (key.equals(loader.key())) { return loader; } } throw new DiagramGeneratorRuntimeException("no loader found for key " + key, null); } private  LoaderHelper(); }
LoaderHelper { public static Loader getLoader(final String key) { for (final Loader loader : ServiceLoader.load(Loader.class)) { if (key.equals(loader.key())) { return loader; } } throw new DiagramGeneratorRuntimeException("no loader found for key " + key, null); } private  LoaderHelper(); static Loader getLoader(final String key); }
LoaderHelper { public static Loader getLoader(final String key) { for (final Loader loader : ServiceLoader.load(Loader.class)) { if (key.equals(loader.key())) { return loader; } } throw new DiagramGeneratorRuntimeException("no loader found for key " + key, null); } private  LoaderHelper(); static Loader getLoader(final String key);  }