LocaleFileWriter { public void writeToFile(File file) throws IOException { int length = LocaleSystem.getIdentifiers().keySet().stream() .min(new StringLengthComparator()) .map(String::length).orElse(0) + 2; addMissingLang(); List<String> lines = createLines(length); write(file, lines); } LocaleFileWriter(Locale locale); void writeToFile(File file);  }
@Test void writesAllIdentifiers(@TempDir Path tempDir) throws IOException { File file = tempDir.resolve("localeFile.txt").toFile(); new LocaleFileWriter(new Locale()).writeToFile(file); long expected = LocaleSystem.getIdentifiers().size(); int result = FileResource.lines(file).size(); assertEquals(expected, result); }