public CompletableFuture<List<ContainerInstance>> describe() {
    return new PaginatedResponseIterator<>(ListContainerInstancesResponse::nextToken, this::list)
        .stream()
        .map(ListContainerInstancesResponse::containerInstanceArns)
        .filter(arns -> !arns.isEmpty())
        .map(this::describeContainerInstances)
        .collect(CompletableFutures.joinList())
        .thenApply(this::extractContainerInstancesFromResponses);
  }
Wrapper around paginated ECS list/describe ContainerInstance APIs that efficiently describes all
tasks.
scheduling-manager/src/main/java/com/amazonaws/blox/scheduling/state/ContainerInstanceLister.java