Example #1
0
 @Test
 public void testSize() {
   ListC<Integer> list = new ListC<>(); // array.length=5
   list.insert(1, 2);
   list.insert(2, 4);
   list.insert(3, 6);
   list.insert(4, 8);
   list.insert(5, 9);
   assertEquals(5, list.size());
 }
Example #2
0
 @Test
 public void testConcat() {
   ListC<Integer> list = new ListC<>(); // array.length=5
   list.insert(1, 2);
   list.insert(2, 4);
   list.insert(3, 6);
   list.insert(4, 8);
   list.insert(5, 9);
   ListC<Integer> list2 = new ListC<>(); // array.length=5
   list.insert(1, 1);
   list.insert(2, 3);
   list.insert(3, 5);
   list.insert(4, 7);
   list.insert(5, 8);
   list.concat(list2);
   assertEquals((Integer) 4, list.retrieve(7));
   assertEquals(10, list.size());
 }