### Question:
SnapshotDirectory { public boolean exists() throws IOException { return fileSystem.exists(directory); } private  SnapshotDirectory(@Nonnull Path directory, @Nonnull FileSystem fileSystem); private  SnapshotDirectory(@Nonnull Path directory); @Nonnull Path getDirectory(); boolean mkdirs(); @Nonnull FileSystem getFileSystem(); boolean exists(); FileStatus[] listStatus(); boolean cleanup(); boolean isSnapshotCompleted(); @Nullable abstract DirectoryStateHandle completeSnapshotAndGetHandle(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); static SnapshotDirectory temporary(@Nonnull File directory); static SnapshotDirectory permanent(@Nonnull Path directory);  }### Answer:
@Test public void exists() throws Exception { File folderRoot = temporaryFolder.getRoot(); File folderA = new File(folderRoot, String.valueOf(UUID.randomUUID())); Assert.assertFalse(folderA.isDirectory()); Path path = new Path(folderA.toURI()); SnapshotDirectory snapshotDirectory = SnapshotDirectory.permanent(path); Assert.assertFalse(snapshotDirectory.exists()); Assert.assertTrue(folderA.mkdirs()); Assert.assertTrue(snapshotDirectory.exists()); Assert.assertTrue(folderA.delete()); Assert.assertFalse(snapshotDirectory.exists()); }