DefaultRepoInitFactory { RepoInitParser newParser() { if (parserClazz != null) { try { return parserClazz.getConstructor().newInstance(); } catch (Exception e) { LOGGER.warn("failed to construct instance of " + parserClazz.getName(), e); } } return null; } DefaultRepoInitFactory(final @Nullable Class<? extends RepoInitParser> parserClazz); static DefaultRepoInitFactory newFactoryInstance(final @NotNull ClassLoader parserCl); static OakMachine.RepoInitProcessor newDefaultRepoInitProcessor(
            final @NotNull ClassLoader defaultClassLoader); static OakMachine.RepoInitProcessor bindParser(final @NotNull RepoInitParser parser);  }
@Test public void testNewParser() { assertNull("null for null", new DefaultRepoInitFactory(null).newParser()); assertNull("null for wrong constructor", new DefaultRepoInitFactory(ParserTypeWrongConstructor.class) .newParser()); assertNotNull("expect non null", new DefaultRepoInitFactory(ParserType.class).newParser()); }