Iterable<File> (File file) { Iterable<File> cached = myDirectoryCache.get(file); if (cached == null) { final Iterable<File> parentFiles = lookupCachedParent(file); if (parentFiles == null || (parentFiles != NULL_ITERABLE && !Iterators.isEmptyCollection(parentFiles))) { try { cached = listFiles(file); } catch (IOException e) { throw new RuntimeException(e); } } myDirectoryCache.put(file, cached == null? NULL_ITERABLE : cached); } return cached == NULL_ITERABLE? null : cached; }