import java.util.*; class G30 { static class Pair<T> { static int count; T a, b; Pair( T a, T b ){ this.a = a; this.b = b; count++; } } public static void main( String[] args ){ List<String> ls = new ArrayList<String>(); List<Integer> li = new ArrayList<Integer>(); System.out.println(ls.getClass() == li.getClass()); Pair<String> ps = new Pair<String>("cool", "stuff"); Pair<Integer> pi = new Pair<Integer>(1, 0); System.out.println(ps.count); Object o = ls; //if( o instanceof Collection<String> ){ // illegal, compilation error Collection<String> cs = (Collection<String>) o; // unchecked warning //} } static <T> T badCast( Object o ){ return (T) o; } // unchecked warning }