// Path: blog-code/src/main/java/pl/ciruk/blog/fanout/CompletableFutures.java
// static <F, T> Function<F, CompletableFuture<Stream<T>>> fanOut(Collection<Function<F, T>> mappings) {
// 	return fanOut(mappings, ForkJoinPool.commonPool());
// }


import com.google.common.collect.ImmutableList;
import org.junit.Test;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import java.util.stream.Stream;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.fail;
import static pl.ciruk.blog.fanout.CompletableFutures.fanOut;
package pl.ciruk.blog.fanout;




public class CompletableFuturesTest {
	@Test
	public void shouldExecuteAllFunctionsFromMappings() throws Exception {
		// Given
		CompletableFuture<String> future = CompletableFuture.completedFuture("SampleText");

		// When
		CompletableFuture<Stream<Integer>> actualFuture = future.thenCompose(
// Path: blog-code/src/main/java/pl/ciruk/blog/fanout/CompletableFutures.java
// static <F, T> Function<F, CompletableFuture<Stream<T>>> fanOut(Collection<Function<F, T>> mappings) {
// 	return fanOut(mappings, ForkJoinPool.commonPool());
// }


// Path: blog-code/src/test/java/pl/ciruk/blog/fanout/CompletableFuturesTest.java
import com.google.common.collect.ImmutableList;
import org.junit.Test;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import java.util.stream.Stream;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.fail;
import static pl.ciruk.blog.fanout.CompletableFutures.fanOut;

package pl.ciruk.blog.fanout;




public class CompletableFuturesTest {
	@Test
	public void shouldExecuteAllFunctionsFromMappings() throws Exception {
		// Given
		CompletableFuture<String> future = CompletableFuture.completedFuture("SampleText");

		// When
		CompletableFuture<Stream<Integer>> actualFuture = future.thenCompose(
				fanOut(ImmutableList.of(