// Path: src/main/java/org/simondean/vertx/async/Async.java
// public final class Async {
//   private Async() {}
// 
//   public static <T> Series<T> series() {
//     return new SeriesImpl<>();
//   }
// 
//   public static WaterfallBuilder waterfall() {
//     return new WaterfallBuilderImpl();
//   }
// 
//   public static <T> IterableBuilder<T> iterable(Iterable<T> iterable) {
//     return new IterableBuilderImpl(iterable);
//   }
// 
//   public static RetryBuilder retry() {
//     return new RetryBuilderImpl();
//   }
// 
//   public static ForeverBuilder forever() {
//     return new ForeverBuilderImpl();
//   }
// }
// 
// Path: src/main/java/org/simondean/vertx/async/ObjectWrapper.java
// public class ObjectWrapper<T> {
//   private T object;
// 
//   public ObjectWrapper() {
//   }
// 
//   public ObjectWrapper(T object) {
//     this.object = object;
//   }
// 
//   public void setObject(T object) {
//     this.object = object;
//   }
// 
//   public T getObject() {
//     return object;
//   }
// }


import org.junit.Test;
import org.simondean.vertx.async.Async;
import org.simondean.vertx.async.ObjectWrapper;
import org.simondean.vertx.async.unit.fakes.*;
import java.util.ArrayList;
import static org.assertj.core.api.Assertions.assertThat;
    items.add("One");

    FakeSuccessfulAsyncFunction<String, Void> each = new FakeSuccessfulAsyncFunction<>(null);

    ObjectWrapper<Integer> handlerCallCount = new ObjectWrapper<>(0);

    Async.iterable(items)
      .each(each)
      .run(new FakeVertx(), result -> {
        handlerCallCount.setObject(handlerCallCount.getObject() + 1);

        assertThat(result).isNotNull();
        assertThat(result.succeeded()).isTrue();
        assertThat(result.result()).isNull();

        assertThat(each.runCount()).isEqualTo(1);
        assertThat(each.consumedValues()).containsExactly("One");
      });

    assertThat(handlerCallCount.getObject()).isEqualTo(1);
  }

  @Test
  public void itExecutesForTwoItems() {
    ArrayList<String> items = new ArrayList<>();
    items.add("One");
    items.add("Two");

    FakeSuccessfulAsyncFunction<String, Void> each = new FakeSuccessfulAsyncFunction<>(null);

// Path: src/main/java/org/simondean/vertx/async/Async.java
// public final class Async {
//   private Async() {}
// 
//   public static <T> Series<T> series() {
//     return new SeriesImpl<>();
//   }
// 
//   public static WaterfallBuilder waterfall() {
//     return new WaterfallBuilderImpl();
//   }
// 
//   public static <T> IterableBuilder<T> iterable(Iterable<T> iterable) {
//     return new IterableBuilderImpl(iterable);
//   }
// 
//   public static RetryBuilder retry() {
//     return new RetryBuilderImpl();
//   }
// 
//   public static ForeverBuilder forever() {
//     return new ForeverBuilderImpl();
//   }
// }
// 
// Path: src/main/java/org/simondean/vertx/async/ObjectWrapper.java
// public class ObjectWrapper<T> {
//   private T object;
// 
//   public ObjectWrapper() {
//   }
// 
//   public ObjectWrapper(T object) {
//     this.object = object;
//   }
// 
//   public void setObject(T object) {
//     this.object = object;
//   }
// 
//   public T getObject() {
//     return object;
//   }
// }


// Path: src/test/java/org/simondean/vertx/async/unit/EachTest.java
import org.junit.Test;
import org.simondean.vertx.async.Async;
import org.simondean.vertx.async.ObjectWrapper;
import org.simondean.vertx.async.unit.fakes.*;
import java.util.ArrayList;
import static org.assertj.core.api.Assertions.assertThat;

    items.add("One");

    FakeSuccessfulAsyncFunction<String, Void> each = new FakeSuccessfulAsyncFunction<>(null);

    ObjectWrapper<Integer> handlerCallCount = new ObjectWrapper<>(0);

    Async.iterable(items)
      .each(each)
      .run(new FakeVertx(), result -> {
        handlerCallCount.setObject(handlerCallCount.getObject() + 1);

        assertThat(result).isNotNull();
        assertThat(result.succeeded()).isTrue();
        assertThat(result.result()).isNull();

        assertThat(each.runCount()).isEqualTo(1);
        assertThat(each.consumedValues()).containsExactly("One");
      });

    assertThat(handlerCallCount.getObject()).isEqualTo(1);
  }

  @Test
  public void itExecutesForTwoItems() {
    ArrayList<String> items = new ArrayList<>();
    items.add("One");
    items.add("Two");

    FakeSuccessfulAsyncFunction<String, Void> each = new FakeSuccessfulAsyncFunction<>(null);

    ObjectWrapper<Integer> handlerCallCount = new ObjectWrapper<>(0);