### Question:
ConfigurationHelper { public Configuration fromFile(String path) throws ConfigurationLoadException { PropertiesConfiguration propertiesConfiguration = setupConfiguration(new PropertiesConfiguration()); propertiesConfiguration.setFileName(path); try { propertiesConfiguration.load(); } catch (ConfigurationException e) { if (Throwables.getRootCause(e) instanceof AccessControlException){ AdsServiceLoggers.ADS_API_LIB_LOG.debug("Properties could not be loaded.", e); } else { throw new ConfigurationLoadException( "Encountered a problem reading the provided configuration file \"" + path + "\"!", e); } } return propertiesConfiguration; }  Configuration fromFile(String path); Configuration fromFile(File path); Configuration fromFile(URL path); Configuration fromSystem(); CombinedConfiguration createCombinedConfiguration(
      @Nullable List<ConfigurationInfo<String>> paths,
      @Nullable List<ConfigurationInfo<URL>> urls); static List<ConfigurationInfo<T>> newList(@Nullable List<T> locations,
      final boolean isOptional); static List<ConfigurationInfo<T>> newList(boolean isOptional, T location);  }### Answer:
@Test public void testFromFile_stringExists() throws Exception { Configuration configuration = configurationHelper.fromFile(createPropertiesFile(test1Properties).toString()); assertPropertiesEquals(test1Properties, configuration); }
@Test public void testFromFile_stringDoesNotExist() throws Exception { thrown.expect(ConfigurationLoadException.class); configurationHelper.fromFile("/" + System.currentTimeMillis()); }
@Test public void testFromFile_fileExists() throws Exception { Configuration configuration = configurationHelper.fromFile(createPropertiesFile(test1Properties)); assertPropertiesEquals(test1Properties, configuration); }
@Test public void testFromFile_urlExists() throws Exception { Configuration configuration = configurationHelper.fromFile(createPropertiesFile(test1Properties).toURI().toURL()); assertPropertiesEquals(test1Properties, configuration); }
@Test public void testFromFile_urlDoesNotExist() throws Exception { thrown.expect(ConfigurationLoadException.class); configurationHelper.fromFile(new URL("file: }
@Test public void testFromFile_urlClasspathExists() throws Exception { Configuration configuration = configurationHelper.fromFile(ConfigurationHelperTest.class .getResource("props/test1.properties")); assertPropertiesEquals(test1Properties, configuration); }
@Test public void testFromFile_listValuesWithDefaultDelimiterUnchanged() throws Exception { Configuration configuration = configurationHelper.fromFile(ConfigurationHelperTest.class .getResource("props/test3.properties")); assertPropertiesEquals(test3Properties, configuration); String[] stringArray = configuration.getStringArray("i.j.k"); assertArrayEquals(new String[]{"foo", "bar"}, stringArray); }
@Test public void testFromFile_listValuesWithDefaultDelimiterChanged() throws Exception { AbstractConfiguration.setDefaultListDelimiter('|'); Configuration configuration = configurationHelper.fromFile( ConfigurationHelperTest.class.getResource("props/test3.properties")); assertPropertiesEquals(test3Properties, configuration); String[] stringArray = configuration.getStringArray("i.j.k"); assertArrayEquals(new String[] {"foo", "bar"}, stringArray); }