code: @SuppressWarnings("unchecked")
      public List<T> toImmutableList() {
          Object[] array = toArray(Object[]::new);
          switch(array.length) {
          case 0:
              return Collections.emptyList();
          case 1:
              return Collections.singletonList((T) array[0]);
          default:
              return Collections.unmodifiableList(Arrays.asList((T[]) array));
          }
      }
docs: Returns an immutable {@link List} containing the elements of this stream.
  There's no guarantees on exact type of the returned {@code List}. The
  returned {@code List} is guaranteed to be serializable if all its
  elements are serializable.
  
  <p>
  This is a terminal operation.
  
  @return a {@code List} containing the elements of this stream
  @see #toList()
  @since 0.6.3