code: public static final Promise all(Promise... promises) {
  		if (promises == null || promises.length == 0) {
  			return Promise.resolve();
  		}
  
  		@SuppressWarnings("unchecked")
  		CompletableFuture<Tree>[] futures = new CompletableFuture[promises.length];
  		for (int i = 0; i < promises.length; i++) {
  			futures[i] = promises[i].future;
  		}
  		CompletableFuture<Void> all = CompletableFuture.allOf(futures);
  		return new Promise(r -> {
  			all.whenComplete((Void, error) -> {
  				try {
  					if (error != null) {
  						r.reject(error);
  						return;
  					}
  					Tree array = new Tree().putList("array");
  					for (int i = 0; i < futures.length; i++) {
  						array.addObject(futures[i].get());
  					}
  					r.resolve(array);
  				} catch (Throwable cause) {
  					r.reject(cause);
  				}
  			});
  		});
  	}
docs: Returns a new Promise that is completed when all of the given Promise
  complete. If any of the given Promise complete exceptionally, then the
  returned Promise also does so, with a Promise holding this exception as
  its cause.
  
  @param promises
  Collection of Promises
  
  @return a new Promise that is completed when all of the given Promises
  complete