code: private static <T> void awaitSettle(final IPromise<T> futures[], final IPromise result) {
          PromiseLatch latch = new PromiseLatch(futures.length);
          latch.getPromise().then( () -> result.complete(futures, null) );
          for (int i = 0; i < futures.length; i++) {
              futures[i].then( () -> latch.countDown() );
          }
      }
docs: changed to non recursive due to stackoverflows ..