class DaemonThreadFactory implements ThreadFactory {

			@Override
			public Thread newThread(Runnable r) {
				Thread t = new Thread(r);
				t.setDaemon(true);
				t.setName("CompletableFutureDelayScheduler");
				return t;
			}

		}

		static final ScheduledThreadPoolExecutor delayer;

		// 注意，这里使用一个线程就可以搞定 因为这个线程并不真的执行请求 而是仅仅抛出一个异常
		static {
			delayer = new ScheduledThreadPoolExecutor(1, new CompletableFutureTimeout.Delayer.DaemonThreadFactory());
			delayer.setRemoveOnCancelPolicy(true);
		}

	}

	public static <T> CompletableFuture<T> timeoutAfter(long timeout, TimeUnit unit) {<FILL_FUNCTION_BODY>

		CompletableFuture<T> result = new CompletableFuture<T>();
		// timeout 时间后 抛出TimeoutException 类似于sentinel / watcher
		CompletableFutureTimeout.Delayer.delayer.schedule(() -> result.completeExceptionally(new TimeoutException()),
				timeout, unit);
		return result;
	
<no_super_class>