public void generateData(final Path dir) {

        ensureAndCleanDir(dir);
        LOGGER.info("Cleaned dir {}", dir);

        generateDataViewingData(dir);
        LOGGER.info("Generated data viewing data");

        generateRefDataForEffectiveDateTesting(dir);
        LOGGER.info("Generated reference data");

        generateCharsetData(dir);
        LOGGER.info("Generated charset data");

        while (true) {
            final int runningTasks = taskCounter.get();
            if (runningTasks == 0) {
                break;
            } else {
                LOGGER.info("Waiting for {} async tasks to complete", runningTasks);
                ThreadUtil.sleep(2_000);
            }
        }
        LOGGER.info("Joining threads");
        CompletableFuture.allOf(futures.toArray(CompletableFuture[]::new)).join();
        LOGGER.info("Completed generation");
    }
To aid testing the generation without running {@link SetupSampleData}
stroom-app/src/test/java/stroom/test/SampleDataGenerator.java