title: How to JUnit test ArrayList.remove()
body: <p>Hi I am trying to test a remove method of ArrayList in JUnit: </p>
  
  <pre><code>@Test
   public void testRemoveCommentValidIndex() 
  {
  
     item.removeComment(2);
      assertEquals("Remove the comment", 2, item.getNumberOfComments());
  
  }
  </code></pre>
  
  <p>so I just check that the size of the ArrayList is reduced by one, which is a bit primitive, so my tutor on the lab told me that it would be better to return the removed item, using reflection, in order to make sure that we removed the right item, which I'm not sure how to do. </p>
  
  <p>Any help would be very much appreciated.</p>