package reflection;

import java.io.Serializable;
import org.junit.Test;
import unit.UnitTestRunner;
import static org.junit.Assert.*;

public class ArrayClassTest {
    
    public static void main(String[] args) {
        UnitTestRunner.run(ArrayClassTest.class);
    }
    
    @Test
    public void primitiveArray() {
        Class<?> c = new int[0].getClass();
        assertEquals("[I", c.getName());
        assertEquals(Object.class, c.getSuperclass());
        assertArrayEquals(new Class<?>[]{Cloneable.class, Serializable.class}, c.getInterfaces());
        assertEquals(0, c.getFields().length);
        assertEquals(0, c.getDeclaredFields().length);
        assertEquals(9, c.getMethods().length);
        assertEquals(0, c.getDeclaredMethods().length);
    }
    
}

@@ -327,84 +327,112 @@
     
-Class%3C?%3E c = new 
+testArrayClass(
 int%5B
-0
 %5D.
-getClass(
+class, %22%5BI%22
 );%0A    
+%7D%0A
     
-assertEquals(%22%5BI%22, c.getName());
+%0A    private void testArrayClass(Class%3C?%3E c, String name) %7B
 %0A   
@@ -479,24 +479,65 @@
 erclass());%0A
+        assertEquals(name, c.getName());%0A
         asse

refactor unit tests