// generics/LostInformation.java // (c)2016 MindView LLC: see Copyright.txt // We make no guarantees that this code is fit for any purpose. // Visit http://OnJava8.com for more book information. import java.util.*; class Frob {} class Fnorkle {} class Quark {} class Particle {} public class LostInformation { public static void main(String[] args) { List list = new ArrayList<>(); Map map = new HashMap<>(); Quark quark = new Quark<>(); Particle p = new Particle<>(); System.out.println(Arrays.toString( list.getClass().getTypeParameters())); System.out.println(Arrays.toString( map.getClass().getTypeParameters())); System.out.println(Arrays.toString( quark.getClass().getTypeParameters())); System.out.println(Arrays.toString( p.getClass().getTypeParameters())); } } /* Output: [E] [K, V] [Q] [POSITION, MOMENTUM] */