title: CompletableFuture: after async call, process result in current thread
body: <p>I am trying to understand the CompletableFuture interface in Java 8.
  My current code is:</p>
  
  <pre><code>CompletableFuture.supplyAsync(() -&gt; wachtwoordBijwerken(gebruikersnaam, wachtwoord))
      .thenAccept(this::saveOrUpdateGebruiker)
      .exceptionally(e -&gt;
      {
          log.error("Fout bij het bijwerken van wachtwoord voor gebruiker: " + gebruikersnaam, e);
          return null;
      });
  </code></pre>
  
  <p>I expected the call <code>saveOrUpdateGebruiker()</code> to run in the main thread after the async call in the newly created thread is completed. 
  However, the call is still in another thread, which causes problems in the underlying hibernate implementation.</p>
  
  <p>Is there a way to use <code>CompletableFuture</code> for a non blocking async call, and still being able to use the result in my current thread?</p>