code: public void retainFiles(Collection<? extends JavaFileObject> sourceFiles) {
          for (Iterator<Env<AttrContext>> it = contents.iterator(); it.hasNext(); ) {
              Env<AttrContext> env = it.next();
              if (!sourceFiles.contains(env.toplevel.sourcefile)) {
                  if (contentsByFile != null) removeByFile(env);
                  it.remove();
              }
          }
      }
docs: Removes all unattributed classes except those belonging to the given
  collection of files.
  
  @param sourceFiles The source files of the classes to keep.