code: public static <T, U> Collector<T, ?, Optional<Double>> percentRankBy(U value, Function<? super T, ? extends U> function, Comparator<? super U> comparator) {
          return collectingAndThen(
              Tuple.collectors(
                  rankBy(value, function, comparator),
                  count()),
              t -> t.map((rank, count) -> rank.map(r -> (double) r / count))
          );
      }
docs: Get a {@link Collector} that calculates the derived <code>PERCENT_RANK()</code> function given a specific ordering.