@Test
public void testToArray() {

  //test a list of size 10
  List<Integer> list = new ArrayList<Integer>();
  for(int i=0; i<10; i++) {
    list.add(i);
  }
  Integer[] arr = GenericsUtil.toArray(list);
  for (int i = 0; i < arr.length; i++) {
    assertEquals(
            "Array has identical elements as input list",
            list.get(i), arr[i]);
  }
}