title: Sync version of async method
body: <p>What's the best way to make a synchronous version of an asynchronous method in Java?</p>
  
  <p>Say you have a class with these two methods:</p>
  
  <pre><code>asyncDoSomething(); // Starts an asynchronous task
  onFinishDoSomething(); // Called when the task is finished 
  </code></pre>
  
  <p>How would you implement a synchronous <code>doSomething()</code> that does not return until the task is finished?</p>