public static void filterFiles() {
        try {
            DirectoryStream<Path> largerThanFourBytes = Files.newDirectoryStream(
                    Paths.get("/home/xander/test"), new DirectoryStream.Filter<Path>(){
                        @Override
                        public boolean accept(Path entry) throws IOException {
                            return Files.size(entry) > 4;
                        }
            });
            for (Path file : largerThanFourBytes) {
                System.out.println(file);
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }