title: AtomicLong operations
body: <p>I need to perform the following operation: </p>
  
  <pre><code>// average, total, elapsed are Long's
  
  average = ( ( total * average ) + elapsed ) / (++total);
  </code></pre>
  
  <p>But I want to use <code>AtomicLong</code></p>
  
  <p>This is what I'm trying but I don't quite get if it is correct: </p>
  
  <pre><code> average.set( (( total.get() * average.get() ) + elapsed) / total.getAndIncrement() );
  </code></pre>
  
  <p>How can I tell if this is correct?</p>