Here you can find the source of castClass(Class> aClass)
@SuppressWarnings("unchecked") public static <T> Class<T> castClass(Class<?> aClass)
//package com.java2s; //License from project: Apache License public class Main { @SuppressWarnings("unchecked") public static <T> Class<T> castClass(Class<?> aClass) { return (Class<T>) aClass; }//from w w w . j a v a 2s. c o m }