List<FilePath> () { Random rng = new Random(0); int totalPaths = 300; int maxLength = 5; List<String> chunks = Arrays.asList("Test1.txt", "Test2.txt", "TEST1.TXT", "TEST2.txt", "Test1-txt", "Test2-txt", "Test1", "Test2", "Test1A1", "Test1b1", "Test1_txt", "Test2_txt", "1", "2", "a", "b", "A", "B", "HierarchicalFilePathComparatorHierarchicalFilePathComparator"); List<FilePath> result = new ArrayList<>(); StringBuilder sb = new StringBuilder(); for (int i = 0; i < totalPaths; i++) { int length = rng.nextInt(maxLength) + 1; sb.setLength(0); for (int j = 0; j < length; j++) { sb.append("/"); sb.append(chunks.get(rng.nextInt(chunks.size()))); } if (rng.nextBoolean()) { sb.append("/"); } result.add(filePath(sb.toString())); } return result; }