### Question:
ConfigurationHelper { public static <T> List<ConfigurationInfo<T>> newList(@Nullable List<T> locations, final boolean isOptional) { if (locations == null) { return null; } return Lists.transform(locations, input -> new ConfigurationInfo<T>(input, isOptional)); }  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 testNewConfigurationInfoList_optional() throws Exception { List<ConfigurationInfo<URL>> configurationInfos = ConfigurationHelper.newList( Lists.newArrayList(new URL("http: assertEquals(2, configurationInfos.size()); assertEquals(new URL("http: assertTrue(configurationInfos.get(0).isOptional()); assertEquals(new URL("https: assertTrue(configurationInfos.get(1).isOptional()); }
@Test public void testNewConfigurationInfoList_required() { List<ConfigurationInfo<String>> configurationInfos = ConfigurationHelper.newList(Lists.newArrayList("1234", "5678"), false); assertEquals(2, configurationInfos.size()); assertEquals("1234", configurationInfos.get(0).getLocation()); assertFalse(configurationInfos.get(0).isOptional()); assertEquals("5678", configurationInfos.get(1).getLocation()); assertFalse(configurationInfos.get(1).isOptional()); }
@Test public void testNewConfigurationInfoList_null() throws Exception { assertNull(ConfigurationHelper.newList(null, true)); }
@Test public void testNewConfigurationInfoList_nullArguments() throws Exception { thrown.expect(IllegalArgumentException.class); ConfigurationHelper.newList(true, (Object[]) null); }