### Question:
ConfigTypeFilters { public static ConfigTypeFilter configTypeWithExtensionOf(File file) { String ext = getExtension(file); if (ext.isEmpty()) { throw new IllegalArgumentException("File " + file + " doesn't have an extension. Unable to resolve component type."); } return types -> types.stream() .filter(t -> t.getSourceExtensions().contains(ext)) .findFirst() .map(Collections::singletonList) .orElseThrow(() -> new IllegalArgumentException("Unsupported config extension '" + ext + "'")); }  static ConfigTypeFilter eachConfigType(); static ConfigTypeFilter configType(ConfigType... types); static ConfigTypeFilter configTypeWithName(String... name); static ConfigTypeFilter configTypeWithExtensionOf(File file);  }### Answer:
@Test void selectByFileExtension() { assertEquals( singletonList(app), configTypeWithExtensionOf(new File("application.app")).selectTypes(supportedTypes) ); }
@Test void failOnFileWithoutExtension() { File badFile = new File("application"); assertThrows(IllegalArgumentException.class, () -> configTypeWithExtensionOf(badFile).selectTypes(supportedTypes)); }