// Path: deferred/src/main/java/com/tuenti/deferred/Promise.java
// enum State {
// 	/**
// 	 * The Promise is still pending - it could be created, submitted for execution,
// 	 * or currently running, but not yet finished.
// 	 */
// 	PENDING,
// 
// 	/**
// 	 * The Promise has finished running and a failure occurred.
// 	 * Thus, the Promise is rejected.
// 	 *
// 	 * @see Deferred#reject(Object)
// 	 */
// 	REJECTED,
// 
// 	/**
// 	 * The Promise has finished running successfully.
// 	 * Thus the Promise is resolved.
// 	 *
// 	 * @see Deferred#resolve(Object)
// 	 */
// 	RESOLVED
// }


import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Future;
import java.util.concurrent.atomic.AtomicInteger;
import org.junit.Assert;
import org.junit.Test;
import com.tuenti.deferred.Promise.State;
		final AtomicInteger alwaysCount = new AtomicInteger();
		
		deferredManager.when(new Callable<Integer>() {
			public Integer call() {
				try {
					Thread.sleep(1000);
				} catch (InterruptedException e) {
				}
				
				return 100;
			}
		}, new Callable<String>() {
			public String call() {
				try {
					Thread.sleep(1000);
				} catch (InterruptedException e) {
				}
				
				return "Hello";
			}
		}).then(new DoneCallback<MultipleResults>() {
			public void onDone(MultipleResults results) {
				Assert.assertEquals(2, results.size());
				Assert.assertEquals(100, results.get(0).getResult());
				Assert.assertEquals("Hello", results.get(1).getResult());
				doneCount.incrementAndGet();
			}
		}).always(new AlwaysCallback<MultipleResults, OneReject>() {

			@Override
// Path: deferred/src/main/java/com/tuenti/deferred/Promise.java
// enum State {
// 	/**
// 	 * The Promise is still pending - it could be created, submitted for execution,
// 	 * or currently running, but not yet finished.
// 	 */
// 	PENDING,
// 
// 	/**
// 	 * The Promise has finished running and a failure occurred.
// 	 * Thus, the Promise is rejected.
// 	 *
// 	 * @see Deferred#reject(Object)
// 	 */
// 	REJECTED,
// 
// 	/**
// 	 * The Promise has finished running successfully.
// 	 * Thus the Promise is resolved.
// 	 *
// 	 * @see Deferred#resolve(Object)
// 	 */
// 	RESOLVED
// }


// Path: deferred/src/test/java/com/tuenti/deferred/MultiplePromisesTest.java
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Future;
import java.util.concurrent.atomic.AtomicInteger;
import org.junit.Assert;
import org.junit.Test;
import com.tuenti.deferred.Promise.State;

		final AtomicInteger alwaysCount = new AtomicInteger();
		
		deferredManager.when(new Callable<Integer>() {
			public Integer call() {
				try {
					Thread.sleep(1000);
				} catch (InterruptedException e) {
				}
				
				return 100;
			}
		}, new Callable<String>() {
			public String call() {
				try {
					Thread.sleep(1000);
				} catch (InterruptedException e) {
				}
				
				return "Hello";
			}
		}).then(new DoneCallback<MultipleResults>() {
			public void onDone(MultipleResults results) {
				Assert.assertEquals(2, results.size());
				Assert.assertEquals(100, results.get(0).getResult());
				Assert.assertEquals("Hello", results.get(1).getResult());
				doneCount.incrementAndGet();
			}
		}).always(new AlwaysCallback<MultipleResults, OneReject>() {

			@Override
			public void onAlways(State state, MultipleResults results,