None of these methods should export HashSet.  They should be exporting Set<String> instead in case we change our internal representation to be something else, e.g a TreeSet, or a custom Set implementation that uses a smaller storage and is easier to construct given the fact that we iterate names in path-order.

You can add it as HashSet<String> here if you then immediately follow up with a change that fixes all of these methods to return Set<String>.  (Or please do the reverse, insert a new commit that fixes the existing methods to return Set<String> and change this commit to return Set<String>.)