title: instance of CompletableFuture cannot get expected result
body: <pre><code>    CompletableFuture cf1 = CompletableFuture.supplyAsync(() -&gt; {
          System.out.println("enter into completableFuture()");
          try {
              TimeUnit.SECONDS.sleep(1);
          } catch (InterruptedException e) {
              e.printStackTrace();
          }
          System.out.println("start to out of completableFuture()");
          return "a";
      });
  
      System.out.println("do something else");
  
      cf1.thenApply(v -&gt; v + " b").thenAcceptAsync(v -&gt;
              System.out.println(v)
      );
  
      System.out.println("finalize...");
  
      //cannot get expected result, if this line was comment out.
      //TimeUnit.SECONDS.sleep(10);
  </code></pre>
  
  <p>code as above.</p>
  
  <p>when writing a example of using CompletableFuture in jdk8, I got confused.</p>
  
  <p>I must add the last line</p>
  
  <p><code>TimeUnit.SECONDS.sleep(10);</code></p>
  
  <p>to get the expected result.</p>
  
  <p>I would like to know whether the program has ended if I do not let its main thread to sleep. if not, why I cannot get the output?</p>
  
  <p>really thanks for you time.</p>