public static void main(String[] args) {
        File file = new File("/home/xander/test");
        String[] names = file.list(new FilenameFilter() {
            @Override
            public boolean accept(File dir, String name) {
                return name.endsWith(".txt");
            }
        });

        for (String name : names) {
            System.out.println(name);
        }

        iterateOverADirectoryWithoutPreloadingItsContentIntoMemory();
    }