public static <T> Class<? extends T> loadClass(String klass, Class<T> base) throws ClassNotFoundException {
        ClassLoader contextOrKafkaClassLoader = Utils.getContextOrKafkaClassLoader();
        // Use loadClass here instead of Class.forName because the name we use here may be an alias
        // and not match the name of the class that gets loaded. If that happens, Class.forName can
        // throw an exception.
        Class<?> loadedClass = contextOrKafkaClassLoader.loadClass(klass);
        // Invoke forName here with the true name of the requested class to cause class
        // initialization to take place.
        return Class.forName(loadedClass.getName(), true, contextOrKafkaClassLoader).asSubclass(base);
    }
Look up a class by name.
@param klass class name
@param base super class of the class for verification
@param <T> the type of the base class
@return the new class
clients/src/main/java/org/apache/kafka/common/utils/Utils.java