// Path: completable-future-demo/src/org/iproduct/cfdemo/Currency.java
// public enum Currency {
// 	BGN, GBP, EUR, USD
// }


import static org.iproduct.cfdemo.Currency.*;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CompletionStage;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;

			}).whenComplete((price, throwable) -> {
				if (price > 0)
					System.out.println("GOOGL stock price in Euro: " + price);
				else
					System.out.println("Timeout: Service took too long to respond.");
			}).join();
		scheduler.shutdownNow();
	}

	public Price getStockPrice(String stockSymbol) {
		//Simulate long running task
		try {
			Thread.sleep(1100);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		switch (stockSymbol) {
		case "GOOGL":
			return new Price(950.28, USD);
		case "AAPL":
			return new Price(148.96, USD);
		case "MSFT":
			return new Price(69.00, USD);
		case "FB":
			return new Price(150.24, USD);
		default:
			throw new RuntimeException("Stocks symbol not found.");
		}
	}


// Path: completable-future-demo/src/org/iproduct/cfdemo/Currency.java
// public enum Currency {
// 	BGN, GBP, EUR, USD
// }


// Path: completable-future-demo/src/org/iproduct/cfdemo/CompletableFutureCompositionTimeout.java
import static org.iproduct.cfdemo.Currency.*;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CompletionStage;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;

			}).whenComplete((price, throwable) -> {
				if (price > 0)
					System.out.println("GOOGL stock price in Euro: " + price);
				else
					System.out.println("Timeout: Service took too long to respond.");
			}).join();
		scheduler.shutdownNow();
	}

	public Price getStockPrice(String stockSymbol) {
		//Simulate long running task
		try {
			Thread.sleep(1100);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		switch (stockSymbol) {
		case "GOOGL":
			return new Price(950.28, USD);
		case "AAPL":
			return new Price(148.96, USD);
		case "MSFT":
			return new Price(69.00, USD);
		case "FB":
			return new Price(150.24, USD);
		default:
			throw new RuntimeException("Stocks symbol not found.");
		}
	}


	public Double getExchangeRate(Currency from, Currency to) {
