class FutureUtils {

	public static void handleUncaughtException(CompletableFuture<?> completableFuture, Thread.UncaughtExceptionHandler uncaughtExceptionHandler) {
		checkNotNull(completableFuture).whenComplete((ignored, throwable) -> {
			if (throwable != null) {
				uncaughtExceptionHandler.uncaughtException(Thread.currentThread(), throwable);
			}
		});
	}

}