@Contract(pure = true)
  public static @Unmodifiable @NotNull <E> List<E> flatten(@NotNull Iterable<? extends Collection<? extends E>> collections) {
    int totalSize = 0;
    for (Collection<? extends E> list : collections) {
      totalSize += list.size();
    }
    List<E> result = new ArrayList<>(totalSize);
    for (Collection<? extends E> list : collections) {
      result.addAll(list);
    }

    return result.isEmpty() ? emptyList() : result;
  }
@Contract(pure = true)
  public static @Unmodifiable @NotNull <E> List<E> flatten(@NotNull Iterable<? extends Collection<? extends E>> collections)