public static CompletableFuture<Integer> length(ArrayReference ref) {
    if (ref instanceof ArrayReferenceImpl && isAsyncEnabled()) {
      return reschedule(((ArrayReferenceImpl)ref).lengthAsync());
    }
    return completedFuture(ref.length());
  }
public static CompletableFuture<Integer> length(ArrayReference ref)