code: private void addDependency(String symbol, Set<String> seen, List<String> list)
        throws ServiceException {
      DependencyInfo dependency = getDependencyInfo(symbol);
      if (dependency == null) {
        if (this.strictRequires) {
          throw new ServiceException("Unknown require of " + symbol);
        }
      } else if (!seen.containsAll(dependency.getProvides())) {
        seen.addAll(dependency.getProvides());
        for (String require : dependency.getRequiredSymbols()) {
          addDependency(require, seen, list);
        }
        list.add(dependency.getPathRelativeToClosureBase());
      }
    }
docs: Adds all the transitive dependencies for a symbol to the provided list. The
  set is used to avoid adding dupes while keeping the correct order. NOTE:
  Use of a LinkedHashSet would require reversing the results to get correct
  dependency ordering.