In a test like this:
@Test
public void test() {
List l = new LinkedList();
l.add(new String [] {\"tes
The List
method are often based on the Object
method equals(Object o)
which compare the object's reference by default.
You may store the tab if you want remove it later, or create your own class and override equals(Object o)
;)
@Test
public void test() {
List l = new LinkedList();
l.add(new String [] {"test", "123"});
String[] tab = new String [] {"test", "456"};
l.add(tab);
l.add(new String [] {"test", "789"});
assertEquals(3, l.size());
l.remove(tab);
assertEquals(2, l.size());
}