ConfigLoader { public static Config getConfigInstance(URI configUri) { Config config; File configFile; String path = configUri.getPath().replaceFirst("^/", ""); switch (configUri.getScheme()) { case "classpath": URL resource = Thread.currentThread().getContextClassLoader().getResource(path); if (resource == null) { throw new IllegalArgumentException("File not found in " + configUri.toString()); } configFile = new File(resource.getFile()); config = new Config(configFile); break; case "file": configFile = new File(path); if (!configFile.exists()) { throw new IllegalArgumentException("File not found in " + configFile.getAbsolutePath()); } config = new Config(configFile); break; case "zookeeper": try { ZookeeperConfigProvider zookeeperConfigProvider = new ZookeeperConfigProvider(configUri); configFile = zookeeperConfigProvider.getConfigFile(); config = new Config(zookeeperConfigProvider); } catch (Exception e) { throw new RuntimeException(e); } break; default: throw new IllegalArgumentException("Scheme not supported - " + configUri.getScheme()); } logger.info("Load config from {} - local file={}", configUri.getScheme(), configFile); return config; } private  ConfigLoader(); static Config getConfigInstance(URI configUri);  }
@Test public void testGetConfigInstance() throws Exception { }