public static @Unmodifiable @NotNull <T> List<T> collect(@NotNull Iterator<? extends T> iterator) {
    if (!iterator.hasNext()) return emptyList();
    List<T> list = new ArrayList<>();
    addAll(list, iterator);
    return list;
  }
public static @Unmodifiable @NotNull <T> List<T> collect(@NotNull Iterator<? extends T> iterator)