public static <T> Set<T> flatten(@NotNull Iterable<? extends Iterable<? extends T>> data) {
    Set<T> result = new HashSet<>();
    for (Iterable<? extends T> i : data) {
      for (T t : i) {
        result.add(t);
      }
    }
    return result;
  }
public static <T> Set<T> flatten(@NotNull Iterable<? extends Iterable<? extends T>> data)