code: @SuppressWarnings("unchecked")
      public <A, R> R collect(IntCollector<A, R> collector) {
          if (collector.characteristics().contains(Collector.Characteristics.IDENTITY_FINISH))
              return (R) collect(collector.supplier(), collector.intAccumulator(), collector.merger());
          return collector.finisher().apply(collect(collector.supplier(), collector.intAccumulator(), collector
                  .merger()));
      }
docs: Performs a mutable reduction operation on the elements of this stream
  using an {@link IntCollector} which encapsulates the supplier,
  accumulator and merger functions making easier to reuse collection
  strategies.
  
  <p>
  Like {@link #reduce(int, IntBinaryOperator)}, {@code collect} operations
  can be parallelized without requiring additional synchronization.
  
  <p>
  This is a terminal operation.
  
  @param <A> the intermediate accumulation type of the {@code IntCollector}
  @param <R> type of the result
  @param collector the {@code IntCollector} describing the reduction
  @return the result of the reduction
  @see #collect(Supplier, ObjIntConsumer, BiConsumer)
  @since 0.3.0