import java.util.concurrent.CompletableFuture;

public class JI9048952 {
	public static void main(String[] args) { 
		CompletableFuture<Object> f1 = new CompletableFuture<>(); 
		CompletableFuture<Object> f2 = f1.thenApply(x -> x); 
		new Thread(() -> f1.completeExceptionally(new RuntimeException())).start(); 
		// prints stack trace without current thread 
		f2.join(); 
	} 
}
