// 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;

	}

	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) {
		if (from.equals(USD) && to.equals(EUR)) {
			return 1.11815d;
		}
		throw new RuntimeException("Exchange rate not available.");
	}


// 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;

	}

	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) {
		if (from.equals(USD) && to.equals(EUR)) {
			return 1.11815d;
		}
		throw new RuntimeException("Exchange rate not available.");
	}


	public Double convertPrice(Price price, Double exchangeRate) {
