public void testShuffleWorks() throws IOException {
  Path dir=wrap(createTempDir());
  Files.createFile(dir.resolve("file1"));
  Files.createFile(dir.resolve("file2"));
  Files.createFile(dir.resolve("file3"));
  List<Path> seen=new ArrayList<>();
  try (DirectoryStream<Path> stream=Files.newDirectoryStream(dir)){
    for (    Path path : stream) {
      seen.add(path);
    }
  }
   assertEquals(3,seen.size());
  assertTrue(seen.contains(dir.resolve("file1")));
  assertTrue(seen.contains(dir.resolve("file2")));
  assertTrue(seen.contains(dir.resolve("file3")));
}

public void testShuffleWorks ( ) throws IOException { Path dir = wrap ( createTempDir ( ) ) ; Files . createFile ( dir . resolve ( "file1" ) ) ; Files . createFile ( dir . resolve ( "file2" ) ) ; Files . createFile ( dir . resolve ( "file3" ) ) ; List < Path > seen = new ArrayList < > ( ) ; try ( DirectoryStream < Path > stream = Files . newDirectoryStream ( dir ) ) { for ( Path path : stream ) { seen . add ( path ) ; } } assertEquals ( 3 , seen . size ( ) ) ; assertTrue ( seen . contains ( dir . resolve ( "file1" ) ) ) ; assertTrue ( seen . contains ( dir . resolve ( "file2" ) ) ) ; assertTrue ( seen . contains ( dir . resolve ( "file3" ) ) ) ; }
test that we return directory listings correctly
