22 lines
710 B
Java
22 lines
710 B
Java
|
package astfactory;
|
||
|
|
||
|
import javafx.collections.ObservableList;
|
||
|
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());
|
||
|
}
|
||
|
}
|