class ClassUtil {

    public static <T> Class<? extends T> getClass(String className,
            Class<T> baseClass) throws ClassNotFoundException {
        ClassLoader classLoader = Thread.currentThread()
                .getContextClassLoader();
        if (classLoader == null) {
            classLoader = ClassUtil.class.getClassLoader();
        }
        return Class.forName(className, true, classLoader)
                .asSubclass(baseClass);
    }

    private  ClassUtil();

}