title: Using conditional statement with ArrayList.size()
body: <p>I tried using the if-else statement as a condition to add elements to an array list. However, it kept adding one more element above the condition.</p>
  
  <pre><code>private ArrayList&lt;Musician&gt; songMusicians;
  this.songMusicians = new ArrayList&lt;&gt;();
  Musician musician = new Musician(name);
  if (songMusicians.size() &lt; 6) { //same output for (songMusicians.size() &lt;= 5)
      songMusicians.add(musician);
  } else {
      System.out.println("You can't have more than 5 musicians per song");
  }
  </code></pre>
  
  <p>So instead of adding 5 elements to the array list songMusicians, it added 6 elements.</p>