in src/main/java/org/apache/cassandra/distributed/shared/FutureUtils.java [50:58]
public static <A, B> Future<B> map(Future<A> future, Function<? super A, ? extends B> fn) {
if (future == null) throw new NullPointerException("Future is null");
if (fn == null) throw new NullPointerException("Function is null");
if (future instanceof CompletableFuture) {
return ((CompletableFuture<A>) future).thenApply(fn);
}
return new MapFuture<>(future, fn);
}