code: private Collection<Key<?>> getRequiredSourcesTargeting(
        DependencyGraph graph, Iterable<Key<?>> targets) {
      Collection<Key<?>> requiredSources = new LinkedHashSet<Key<?>>();
      for (Key<?> target : targets) {
        for (Dependency edge : graph.getDependenciesTargeting(target)) {
          if (!edge.isOptional()) {
            PrettyPrinter.log(logger, TreeLogger.DEBUG, "Removing the key %s because of %s",
                edge.getSource(), edge);
            requiredSources.add(edge.getSource());
          }
        }
      }
      return requiredSources;
    }
docs: Returns all of the source keys that have a required dependency on any key in the target set.