@Test
public void getArrayClass() {

    // dim < 0
    try {
        ClassUtil.getArrayClass(int.class, -1);
        fail();
    } catch (IllegalArgumentException e) {
        assertThat(e, TestUtil.exception("wrong dimension: -1"));
    }
    // null
    assertNull(ClassUtil.getArrayClass(null, 1));
    // form 1
    assertEquals(int[].class, ClassUtil.getArrayClass(int.class));
    assertEquals(int[][].class, ClassUtil.getArrayClass(int[].class));
    assertEquals(Integer[].class, ClassUtil.getArrayClass(Integer.class));
    assertEquals(Integer[][].class, ClassUtil.getArrayClass(Integer[].class));
    // form 2
    assertEquals(int.class, ClassUtil.getArrayClass(int.class, 0));
    assertEquals(int[].class, ClassUtil.getArrayClass(int.class, 1));
    assertEquals(int[][].class, ClassUtil.getArrayClass(int.class, 2));
    assertEquals(int[].class, ClassUtil.getArrayClass(int[].class, 0));
    assertEquals(int[][].class, ClassUtil.getArrayClass(int[].class, 1));
    assertEquals(int[][][].class, ClassUtil.getArrayClass(int[].class, 2));
    assertEquals(String.class, ClassUtil.getArrayClass(String.class, 0));
    assertEquals(String[].class, ClassUtil.getArrayClass(String.class, 1));
    assertEquals(String[][].class, ClassUtil.getArrayClass(String.class, 2));
    assertEquals(ClassUtilTest[].class, ClassUtil.getArrayClass(ClassUtilTest[].class, 0));
    assertEquals(ClassUtilTest[][].class, ClassUtil.getArrayClass(ClassUtilTest[].class, 1));
    assertEquals(ClassUtilTest[][][].class, ClassUtil.getArrayClass(ClassUtilTest[].class, 2));
}