Hi I am trying to test a remove method of ArrayList in JUnit:
@Test
public void testRemoveCommentValidIndex()
{
item.removeComment(2);
assertEquals("Remove the comment", 2, item.getNumberOfComments());
}
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.
Any help would be very much appreciated.