code: public <A> Set<A> getAllDependants(
        A item, Function<A, Integer> getDepth, Function<A, Set<A>> getDependants) {
      Set<A> currentGeneration = singleton(item);
      Set<A> result = newHashSet();
      Set<A> visited = newHashSet();
  
      for (int depth = 0; !currentGeneration.isEmpty(); depth++) {
        currentGeneration =
            copyOf(difference(getDirectDependants(currentGeneration, getDependants), visited));
        result.addAll(
            currentGeneration.stream().filter(getDepthFilter(depth, getDepth)).collect(toSet()));
        visited.addAll(currentGeneration);
      }
  
      return result;
    }
docs: Retrieves all items that depend on a given item.
  
  @param item the item that the other items depend on
  @param getDepth function that returns the depth up to which a specific item's dependencies are
  resolved
  @param getDependants function that returns the items that depend on a specific item
  @param <A> the type of the item
  @return Set of items that directly or indirectly depend on the given item