@Override
    public boolean find(final Path file, final ListProgressListener listener) throws BackgroundException {
        final boolean exists = Files.exists(session.toPath(file), LinkOption.NOFOLLOW_LINKS);
        if(exists) {
            if(Files.isSymbolicLink(session.toPath(file))) {
                return true;
            }
            if(!file.isRoot()) {
                try {
                    if(!StringUtils.equals(session.toPath(file).toFile().getCanonicalFile().getName(), file.getName())) {
                        return false;
                    }
                }
                catch(IOException e) {
                    log.warn(String.format("Failure obtaining canonical file reference for %s", file));
                }
            }
        }
        return exists;
    }
@Test
    public void testFindSymlink() throws Exception {
        final LocalSession session = new LocalSession(new Host(new LocalProtocol(), new LocalProtocol().getDefaultHostname()));
        assumeTrue(session.isPosixFilesystem());
        session.open(new DisabledProxyFinder(), new DisabledHostKeyCallback(), new DisabledLoginCallback(), new DisabledCancelCallback());
        session.login(new DisabledLoginCallback(), new DisabledCancelCallback());
        final Path home = new LocalHomeFinderFeature().find();
        final Path file = new Path(home, UUID.randomUUID().toString(), EnumSet.of(Path.Type.file, Path.Type.symboliclink));
        // Symlink to non existing target
        new LocalSymlinkFeature(session).symlink(file, UUID.randomUUID().toString());
        assertTrue(new LocalFindFeature(session).find(file));
        session.close();
    }