JavaCompilerCore/test/astfactory/ASTFactoryTest.java

22 lines
712 B
Java
Raw Permalink Normal View History

2017-03-08 16:51:59 +00:00
package astfactory;
//import javafx.collections.ObservableList;
2017-03-08 16:51:59 +00:00
import org.junit.Test;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.lang.reflect.TypeVariable;
import java.util.Arrays;
import java.util.HashMap;
import static org.junit.Assert.*;
public class ASTFactoryTest<A> extends HashMap<String, A>{
@Test
public void test(){
System.out.println((this.getClass().getGenericSuperclass()));
Type[] arguments = ((ParameterizedType) this.getClass().getGenericSuperclass()).getActualTypeArguments();
System.out.println(Arrays.toString(arguments));
System.out.println(((TypeVariable)arguments[1]).getGenericDeclaration());
}
}