title: Return CompletableFuture<Void> or CompletableFuture<?>?
body: <p>I want to write an asynchronous method that returns a <a href="http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/CompletableFuture.html"><code>CompletableFuture</code></a>. The only purpose of the future is to track when the method is complete, not its result. Would it be better to return <code>CompletableFuture&lt;Void&gt;</code> or <code>CompletableFuture&lt;?&gt;</code>? Is there a reason to prefer one or the other, or are they interchangeable?</p>
  
  <ul>
  <li><a href="http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/CompletableFuture.html"><code>CompletableFuture</code></a> itself returns <code>CompletableFuture&lt;Void&gt;</code> from many of its methods.</li>
  <li><code>java.nio</code> has a <code>Future&lt;Void&gt;</code> in <a href="http://docs.oracle.com/javase/8/docs/api/java/nio/channels/AsynchronousSocketChannel.html"><code>AsynchronousSocketChannel</code></a>: <code>Future&lt;Void&gt; connect(SocketAddress remote)</code>.</li>
  <li>On the other hand, <code>java.util.concurrent</code> classes like <a href="http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ExecutorService.html"><code>ExecutorService</code></a> and <a href="http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ScheduledExecutorService.html"><code>ScheduledExecutorService</code></a> return <code>Future&lt;?&gt;</code>: for instance, with <code>Future&lt;?&gt; submit(Runnable task)</code>.</li>
  </ul>
  
  <p>Note that I'm only asking about return types, not parameter lists, variable declarations, or other contexts.</p>