@Test
  public void testDircountZero() throws Exception {
    final String file = MergeLogFilesIntegrationTest.class
        .getResource("MergeLogFilesIntegrationTest.txt").getPath();
    final String path = new File(file).getParentFile().getPath();
    final String resourcePath1 = IOUtils.appendToPath(path, "dir1", "systemlog.txt");
    final String resourcePath2 = IOUtils.appendToPath(path, "dir2", "systemlog.txt");
    final List<File> files = Arrays.asList(
        new File(resourcePath1),
        new File(resourcePath2));
    Map<String, MergeLogFiles.DisplayNameAndFileStream> logFiles =
        MergeLogFiles.getStringDisplayNameAndFileStreamMap(
            files,
            0, false, null);
    try {
      assertThat(logFiles.size()).isEqualTo(2);
    } finally {
      logFiles.values().stream().forEach(displayNameAndFileStream -> {
        try {
          displayNameAndFileStream.getInputStream().close();
        } catch (IOException e) {
          e.printStackTrace();
        }
      });
    }
  }
A bunch of threads write a strictly increasing integer to log "files" stored in byte arrays.
The files are merged and the order is verified.
geode-core/src/integrationTest/java/org/apache/geode/internal/logging/MergeLogFilesIntegrationTest.java