private void generateCharsetData(final Path dir) {

        final Path multipleLanguagesFile = templatesDir.resolve(multipleLanguagesFileName);
        final AtomicInteger counter = new AtomicInteger(0);

        try {
            final String sourceContent = Files.readString(
                    multipleLanguagesFile, StandardCharsets.UTF_8);

            Stream.of(
                            Tuple.of("UTF8_BOM", StandardCharsets.UTF_8, ByteOrderMark.UTF_8),
                            Tuple.of("UTF8_NO_BOM", StandardCharsets.UTF_8, (ByteOrderMark) null),

                            // Stroom doesn't support straight UTF16
                            Tuple.of("UTF16LE_BOM", StandardCharsets.UTF_16LE, ByteOrderMark.UTF_16LE),
                            Tuple.of("UTF16LE_NO_BOM", StandardCharsets.UTF_16LE, (ByteOrderMark) null),
                            Tuple.of("UTF16BE_BOM", StandardCharsets.UTF_16BE, ByteOrderMark.UTF_16BE),
                            Tuple.of("UTF16BE_NO_BOM", StandardCharsets.UTF_16BE, (ByteOrderMark) null),

                            // Stroom doesn't support straight UTF32
                            Tuple.of("UTF32LE_BOM", Charset.forName("UTF-32LE"), ByteOrderMark.UTF_32LE),
                            Tuple.of("UTF32LE_NO_BOM", Charset.forName("UTF-32LE"), (ByteOrderMark) null),
                            Tuple.of("UTF32BE_BOM", Charset.forName("UTF-32BE"), ByteOrderMark.UTF_32BE),
                            Tuple.of("UTF32BE_NO_BOM", Charset.forName("UTF-32BE"), (ByteOrderMark) null)
                    )
                    .forEach(tuple3 -> {
                        final String feedName = "TEST_CHARSETS_" + tuple3._1() + "-REFERENCE";
                        generateDataForCharset(
                                feedName,
                                dir,
                                tuple3._2(),
                                tuple3._3(),
                                sourceContent,
                                counter.getAndIncrement());
                    });
        } catch (IOException e) {
            throw new RuntimeException(LogUtil.message("Error reading file {}",
                    multipleLanguagesFile.toAbsolutePath()), e);
        }
    }
To aid testing the generation without running {@link SetupSampleData}
stroom-app/src/test/java/stroom/test/SampleDataGenerator.java