@Override
    public Iterable<JavaFileObject> list(Location location, String pkg, Set<Kind> kinds,
            boolean recurse) throws IOException {

        List<JavaFileObject> result = new ArrayList<JavaFileObject>();
        for (JavaFileObject f : super.list(location, pkg, kinds, recurse)) {
            result.add(f);
        }
        if (location == StandardLocation.CLASS_PATH) {
            location = StandardLocation.CLASS_OUTPUT;
        }

        for (Kind kind : kinds) {
            LocationAndKind key = new LocationAndKind(location, kind);
            if (ramFileSystem.containsKey(key)) {
                Map<String, JavaFileObject> locatedFiles = ramFileSystem.get(key);
                for (Map.Entry<String, JavaFileObject> entry : locatedFiles.entrySet()) {
                    String name = entry.getKey();
                    String packageName = "";
                    if (name.indexOf('.') > -1) {
                        packageName = name.substring(0, name.lastIndexOf('.'));
                    }
                    if (recurse ? packageName.startsWith(pkg) : packageName.equals(pkg)) {
                        JavaFileObject candidate = entry.getValue();
                        if (kinds.contains(candidate.getKind())) {
                            result.add(candidate);
                        }
                    }
                }
            }
        }
        return result;
    }
MemFileManager is a memory based implementation of the JavaFileManager
interface

@author tiwe
querydsl-codegen-utils/src/main/java/com/querydsl/codegen/utils/MemFileManager.java