title: Mirror method using arraylist
body: <p>I am writing a "Mirror" method which duplicate the message backward, and add to the original ArrayList if the size is even. </p>
  
  <pre><code>public ArrayList&lt;Integer&gt; mirror(ArrayList&lt;Integer&gt; mr) {
      if (mr.size() % 2 == 0) {
  
          for (int i = mr.size() - 1; i &gt; 0; i--) {
              mr.add(mr.get(i));
          }
      }
      return mr;
  }
  </code></pre>
  
  <p>This one does not give 1 though.<br>
  e.g.</p>
  
  <pre><code>[1,2,3,4]-&gt;[1,2,3,4,4,3,2]
  </code></pre>
  
  <p>If i>0 is changed to i>=0, then</p>
  
  <pre><code>[1,2,3,4]-&gt; [1, 2, 3, 4, 4, 3, 2, 1, 1, 2, 3, 4, 4, 3, 2, 1]
  </code></pre>