docs: public static <T> Collector<T, ?, T> toOneElement() {
      return java.util.stream.Collectors.collectingAndThen(
        java.util.stream.Collectors.toList(),
        list -> {
          if (list.size() != 1) {
            throw new IllegalStateException("Stream should have only one element");
          }
          return list.get(0);
        });
    }