package org.codefx.lab.lambda.instances;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;

/**
 * Creates instances of {@link Future}.
 */
public class FutureFactory {

	private FutureFactory() {
		// private constructor for utility class
	}

	/**
	 * Creates a new future with the default result.
	 *
	 * @return a new {@link Future}
	 */
	static Future<Integer> createWithDefaultResult() {
		ImmediateFuture<Integer> immediateFuture = () -> 0;
		return immediateFuture;
	}

	/**
	 * Creates a new future which returns a random result on each {@link Future#get() get()}.
	 *
	 * @return a new {@link Future}
	 */
	static Future<Integer> createWithRandomResult() {
		ImmediateFuture<Integer> immediateFuture = new ImmediateFuture<Integer>() {

			@Override
			public Integer get() throws InterruptedException, ExecutionException {
				return (int) Math.random() * 10;
			}
		};
		return immediateFuture;
	}

	/**
	 * Creates a new future with the specified result.
	 *
	 * @param result
	 *            the {@link Future#get() result} of the returned future
	 * @return a new {@link Future}
	 */
	static Future<Integer> createWithResult(Integer result) {
		ImmediateFuture<Integer> immediateFuture = () -> result;
		return immediateFuture;
	}

}

@@ -362,32 +362,39 @@
 k Future%7D%0A%09 */%0A%09
+public 
 static Future%3CIn
@@ -643,32 +643,39 @@
 k Future%7D%0A%09 */%0A%09
+public 
 static Future%3CIn
@@ -1139,16 +1139,23 @@
 %7D%0A%09 */%0A%09
+public 
 static F

Make all methods in 'FutureFactory' public.