title: Is it good practice to use AtomicInteger as a substitute for mutable Integer?
body: <p>I have following kind of scenario:
  It is simple form of code that I am showing here to clarify my concern:</p>
  
  <pre><code>public void callMe()
  {
   AtomicInteger howManyOdds = new AtomicInteger(0);
   AtomicInteger howManyEvens = new AtomicInteger(0);
   loopThrough(100,howManyOdds,howManyEvens);
   System.out.println(howManyOdds.get()+" "+howManyEvens.get());
  }
  private void loopThrough(int counter,AtomicInteger howManyOdds,AtomicInteger howManyEvens)
  {
   for(int i = 1 ; i &lt;= counter ;i++)
   {
    if(i%2 == 0)
    howManyEvens.getAndAdd(1);
    else
    howManyOdds.getAndAdd(1);
   }
  }
  </code></pre>
  
  <p>I know that it can be done by <code>int[]</code> but it looks kind of odd. Is AtomicInteger a good substitute for Mutable Integer in such kind of cases? <strong>If No then WHY?</strong></p>