void () { assumeWindows(); var nioAttributes = new BasicFileAttributes() { @Override public FileTime lastModifiedTime() { return FileTime.from(Instant.now()); } @Override public FileTime lastAccessTime() { return lastModifiedTime(); } @Override public FileTime creationTime() { return lastModifiedTime(); } @Override public boolean isRegularFile() { return false; } @Override public boolean isDirectory() { return true; } @Override public boolean isSymbolicLink() { return false; } @Override public boolean isOther() { return true; } @Override public long size() { return 0; } @Override public Object fileKey() { return null; } }; var rootAttributes = FileAttributes.fromNio(Path.of(System.getenv("SystemDrive") + '\\'), nioAttributes); assertTrue(rootAttributes.isDirectory()); assertEquals(FileAttributes.Type.DIRECTORY, rootAttributes.getType()); assertFalse(rootAttributes.isSymLink()); var dirAttributes = FileAttributes.fromNio(Path.of(System.getenv("USERPROFILE")), nioAttributes); assertTrue(dirAttributes.isDirectory()); assertEquals(FileAttributes.Type.DIRECTORY, dirAttributes.getType()); assertTrue(dirAttributes.isSymLink()); }