if (CompletableFuture.class.isAssignableFrom(returnType)) {
@SuppressWarnings("rawtypes")
CompletableFuture result = new CompletableFuture();
callCompletableAsync(call, (r,hadException,exception) -> {
if (hadException) result.completeExceptionally(exception);
else result.complete(r);
});
// And return the CompletableFuture
return result;
}
// Else if it's an IFuture then return