code: public static <T, A, R, RR> Collector<T, A, RR> collectingAndThen(Collector<T, A, R> downstream,
              Function<R, RR> finisher) {
          Predicate<A> finished = finished(downstream);
          if (finished != null) {
              return new CancellableCollectorImpl<>(downstream.supplier(), downstream.accumulator(), downstream
                      .combiner(), downstream.finisher().andThen(finisher), finished, downstream.characteristics()
                              .contains(Characteristics.UNORDERED) ? UNORDERED_CHARACTERISTICS : NO_CHARACTERISTICS);
          }
          return Collectors.collectingAndThen(downstream, finisher);
      }
docs: Adapts a {@code Collector} to perform an additional finishing
  transformation.
  
  <p>
  Unlike {@link Collectors#collectingAndThen(Collector, Function)} this
  method returns a
  <a href="package-summary.html#ShortCircuitReduction">short-circuiting
  collector</a> if the downstream collector is short-circuiting.
  
  @param <T> the type of the input elements
  @param <A> intermediate accumulation type of the downstream collector
  @param <R> result type of the downstream collector
  @param <RR> result type of the resulting collector
  @param downstream a collector
  @param finisher a function to be applied to the final result of the
  downstream collector
  @return a collector which performs the action of the downstream
  collector, followed by an additional finishing step
  @see Collectors#collectingAndThen(Collector, Function)
  @since 0.4.0