### Question:
ConfigTypeImpl implements ConfigType { public static ConfigType byNameAndExtensions(String name, Set<String> sourceExtensions, String resultFileName) { List<String> badExtensions = filter(sourceExtensions, ext -> !ext.startsWith(".")); if (!badExtensions.isEmpty()) { throw new IllegalArgumentException("File extension must start with '.'. Current: " + badExtensions); } return new ConfigTypeImpl(name, sourceExtensions, resultFileName); }  static ConfigType byName(String name); static ConfigType byNameAndExtensions(String name, Set<String> sourceExtensions, String resultFileName);  }### Answer:
@Test void createByNameAndExtension() { ConfigType app = byNameAndExtensions("app", singleton(".yaml"), "application"); assertEquals("app", app.getName()); assertEquals("application", app.getResultFileName()); assertEquals(singleton(".yaml"), app.getSourceExtensions()); }
@Test void extensionsShouldStartWithDot() { Set<String> withBadExtension = setOf(".json", "yaml"); assertThrows(IllegalArgumentException.class, () -> byNameAndExtensions("app", withBadExtension, "application")); }