public boolean fileIsInAllowedPath(Path path) {
        if (allowedPaths.isEmpty()) {
            return true;
        }

        final Path realFilePath = resolveRealPath(path);
        if (realFilePath == null) {
            return false;
        }
        for (Path allowedPath : allowedPaths) {
            final Path realAllowedPath = resolveRealPath(allowedPath);
            if (realAllowedPath != null && realFilePath.startsWith(realAllowedPath)) {
                return true;
            }
        }
        return false;
    }
@Test
    public void outsideOfAllowedPath() throws IOException {
        final Path permittedPath = permittedTempDir.getRoot().toPath();
        final Path filePath = forbiddenTempDir.newFile(FILE).toPath();
        pathChecker = new AllowedAuxiliaryPathChecker(new TreeSet<>(Collections.singleton(permittedPath)));
        assertFalse(pathChecker.fileIsInAllowedPath(filePath));
    }