PoolThread { public void await() { ExecutorService pool = Executors.newCachedThreadPool(); for (int i = 0; i < 100; i++) { pool.execute(getThread(i + "")); } pool.shutdown(); try { pool.awaitTermination(Long.MAX_VALUE, TimeUnit.DAYS); } catch (InterruptedException e) { e.printStackTrace(); } log.info("所有线程执行结束了噢！！！！"); }  static void main(String[] args); void cachedThreadPool(); void fixedThread(); void singleThread(); void schelThread(); void await(); Thread getThread(final String name); Thread getSingleThread(final String name); Thread getSleepThread(final String name);  }
@Test public void testAwait() throws Exception { PoolThread pt = new PoolThread(); pt.await(); }