@Test
    void testStatisticsDataSource() {
        final ExplorerNode statNode = explorerService.create(StatisticStoreDoc.TYPE, "StatName1", null, null);
        final StatisticStoreDoc statisticsDataSource = statisticStoreStore.readDocument(statNode.getDocRef());
        statisticsDataSource.setDescription("My Description");
        statisticsDataSource.setStatisticType(StatisticType.COUNT);
        statisticsDataSource.setConfig(new StatisticsDataSourceData());
        statisticsDataSource.getConfig().addStatisticField(new StatisticField("tag1"));
        statisticsDataSource.getConfig().addStatisticField(new StatisticField("tag2"));
        statisticStoreStore.writeDocument(statisticsDataSource);

        assertThat(statisticStoreStore.list().size()).isEqualTo(1);

        final Path testDataDir = getCurrentTestDir().resolve("ExportTest");

        FileUtil.deleteDir(testDataDir);
        FileUtil.mkdirs(testDataDir);

        importExportSerializer.write(testDataDir, buildFindFolderCriteria(), true);

        assertThat(FileUtil.count(testDataDir)).isEqualTo(2);

        // now clear out the java entities and import from file
        commonTestControl.clear();

        assertThat(statisticStoreStore.list().size()).isEqualTo(0);

        importExportSerializer.read(testDataDir, null, ImportSettings.auto());

        final List<DocRef> dataSources = statisticStoreStore.list();

        assertThat(dataSources.size()).isEqualTo(1);

        final StatisticStoreDoc importedDataSource = statisticStoreStore.readDocument(dataSources.get(0));

        assertThat(importedDataSource.getName()).isEqualTo(statisticsDataSource.getName());
        assertThat(importedDataSource.getStatisticType()).isEqualTo(statisticsDataSource.getStatisticType());
        assertThat(importedDataSource.getDescription()).isEqualTo(statisticsDataSource.getDescription());

        assertThat(importedDataSource.getConfig()).isEqualTo(statisticsDataSource.getConfig());
    }
Create a populated {@link StatisticStore} object, serialise it to file,
de-serialise it back to an object then compare the first object with the
second one
stroom-app/src/test/java/stroom/statistics/impl/sql/TestStatisticsDataSourceImportExportSerializer.java