// 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 org.junit.Test;
import com.tuenti.deferred.Promise.State;
		thenTheCallbackIsExecutedOnTheExecutor(computationExecutor);
	}

	@Test
	public void testAlwaysDiskIsExecutedInDiskExecutor() {
		givenADeferredObject();
		Always.Disk<Void, Void> callback = givenADiskCallback();

		whenTheDeferredIsFinishedAndAnAlwaysCallbackIsSet(callback);

		thenTheCallbackIsExecutedOnTheExecutor(diskExecutor);
	}

	@Test
	public void testAlwaysNetworkIsExecutedInNetworkExecutor() {
		givenADeferredObject();
		Always.Network<Void, Void> callback = givenANetworkCallback();

		whenTheDeferredIsFinishedAndAnAlwaysCallbackIsSet(callback);

		thenTheCallbackIsExecutedOnTheExecutor(networkExecutor);
	}

	private void whenTheDeferredIsFinishedAndAnAlwaysCallbackIsSet(AlwaysCallback<Void, Void> callback) {
		deferred.resolve(null).always(callback);
	}

	private Always.UI<Void, Void> givenAUICallback() {
		return new Always.UI<Void, Void>() {
			@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/AlwaysCallbacksTest.java
import org.junit.Test;
import com.tuenti.deferred.Promise.State;

		thenTheCallbackIsExecutedOnTheExecutor(computationExecutor);
	}

	@Test
	public void testAlwaysDiskIsExecutedInDiskExecutor() {
		givenADeferredObject();
		Always.Disk<Void, Void> callback = givenADiskCallback();

		whenTheDeferredIsFinishedAndAnAlwaysCallbackIsSet(callback);

		thenTheCallbackIsExecutedOnTheExecutor(diskExecutor);
	}

	@Test
	public void testAlwaysNetworkIsExecutedInNetworkExecutor() {
		givenADeferredObject();
		Always.Network<Void, Void> callback = givenANetworkCallback();

		whenTheDeferredIsFinishedAndAnAlwaysCallbackIsSet(callback);

		thenTheCallbackIsExecutedOnTheExecutor(networkExecutor);
	}

	private void whenTheDeferredIsFinishedAndAnAlwaysCallbackIsSet(AlwaysCallback<Void, Void> callback) {
		deferred.resolve(null).always(callback);
	}

	private Always.UI<Void, Void> givenAUICallback() {
		return new Always.UI<Void, Void>() {
			@Override
			public void onAlways(State state, Void resolved, Void rejected) {