Maybe it is better to use a Set instead of a List here. That way you can use add, or addAll without adding duplicates. Add() runs in log(n) worst case according to the Java Docs. Whereas iterating over duplicates in a method that would calculate depedencies is unpredictable. 

(offtopic: Yay, in a pull request you can add comments in a line :+1: )