code: public static <T, U, A, R> Collector<T, ?, R> mapping(Function<? super T, ? extends U> mapper,
              Collector<? super U, A, R> downstream) {
          Predicate<A> finished = finished(downstream);
          if (finished != null) {
              BiConsumer<A, ? super U> downstreamAccumulator = downstream.accumulator();
              return new CancellableCollectorImpl<>(downstream.supplier(), (acc, t) -> {
                  if (!finished.test(acc))
                      downstreamAccumulator.accept(acc, mapper.apply(t));
              }, downstream.combiner(), downstream.finisher(), finished, downstream.characteristics());
          }
          return Collectors.mapping(mapper, downstream);
      }
docs: Adapts a {@code Collector} accepting elements of type {@code U} to one
  accepting elements of type {@code T} by applying a mapping function to
  each input element before accumulation.
  
  <p>
  Unlike {@link Collectors#mapping(Function, Collector)} 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 <U> type of elements accepted by downstream collector
  @param <A> intermediate accumulation type of the downstream collector
  @param <R> result type of collector
  @param mapper a function to be applied to the input elements
  @param downstream a collector which will accept mapped values
  @return a collector which applies the mapping function to the input
  elements and provides the mapped results to the downstream
  collector
  @see Collectors#mapping(Function, Collector)
  @since 0.4.0