@@ -0,0 +1,1540 @@
+package com.yuzhouwan.hacker.jvm;%0A%0Aimport org.junit.Test;%0A%0Aimport static org.junit.Assert.assertEquals;%0A%0A/**%0A * Copyright @ 2018 yuzhouwan.com%0A * All right reserved.%0A * Function%EF%BC%9AClass Test%0A *%0A * @author Benedict Jin%0A * @since 2018/2/25%0A */%0Apublic class ClassTest %7B%0A%0A    @Test%0A    public void isAssignableFromTest() %7B%0A        %7B%0A            // If those classes were hold by different classloaders will got the %60false%60 result,%0A            // Then we can solve that by serializing.%0A            assertEquals(true, A.class.isAssignableFrom(B.class));%0A            assertEquals(true, B.class.isAssignableFrom(C.class));%0A            assertEquals(true, A.class.isAssignableFrom(C.class));%0A            assertEquals(true, A.class.getClassLoader().equals(B.class.getClassLoader()));%0A            assertEquals(true, B.class.getClassLoader().equals(C.class.getClassLoader()));%0A        %7D%0A        %7B%0A            Class%3C? extends Class%3E aClass = A.class.getClass();%0A            Class%3C? extends Class%3E bClass = B.class.getClass();%0A        %7D%0A    %7D%0A%0A    @Test%0A    public void newInstanceTest() %7B%0A        boolean failed = false;%0A        try %7B%0A            B b = (B) C.class.newInstance();%0A        %7D catch (Exception e) %7B%0A            failed = true;%0A        %7D%0A        assertEquals(false, failed);%0A        failed = false;%0A        try %7B%0A            C c = (C) B.class.newInstance();%0A        %7D catch (Exception e) %7B%0A            failed = true;%0A        %7D%0A        assertEquals(true, failed);%0A    %7D%0A%7D%0A%0Ainterface A %7B%0A%7D%0A%0Aabstract class B implements A %7B%0A%7D%0A%0Aclass C extends B %7B%0A%7D%0A

Add testcase for class