code: public void findAllDependencies(
              ClassFileReader classFinder, Set<String> rootClassNames,
              boolean transitiveClosure, Recorder recorder)
              throws ClassFileNotFoundException {
          Set<String> doneClasses = new HashSet<String>();
  
          getFinder();  // ensure initialized
          getFilter();  // ensure initialized
  
          // Work queue of names of classfiles to be searched.
          // Entries will be unique, and for classes that do not yet have
          // dependencies in the results map.
          Deque<String> deque = new LinkedList<String>(rootClassNames);
  
          String className;
          while ((className = deque.poll()) != null) {
              assert (!doneClasses.contains(className));
              doneClasses.add(className);
  
              ClassFile cf = classFinder.getClassFile(className);
  
              // The following code just applies the filter to the dependencies
              // followed for the transitive closure.
              for (Dependency d: finder.findDependencies(cf)) {
                  recorder.addDependency(d);
                  if (transitiveClosure && filter.accepts(d)) {
                      String cn = d.getTarget().getClassName();
                      if (!doneClasses.contains(cn))
                          deque.add(cn);
                  }
              }
          }
      }
docs: Find the dependencies of a class, using the current
  {@link Dependencies#getFinder finder} and
  {@link Dependencies#getFilter filter}.
  The search may optionally include the transitive closure of all the
  filtered dependencies, by also searching in the classes named in those
  dependencies.
  @param classFinder a finder to locate class files
  @param rootClassNames the names of the root classes from which to begin
  searching
  @param transitiveClosure whether or not to also search those classes
  named in any filtered dependencies that are found.
  @param recorder a recorder for handling the results
  @throws ClassFileNotFoundException if a required class file cannot be found
  @throws ClassFileError if an error occurs while processing a class file,
  such as an error in the internal class file structure.