public static <T> T newInstance(Class<?> klass, Class<T> base) {
        return Utils.newInstance(klass.asSubclass(base));
    }
Cast {@code klass} to {@code base} and instantiate it.
@param klass The class to instantiate
@param base A know baseclass of klass.
@param <T> the type of the base class
@throws ClassCastException If {@code klass} is not a subclass of {@code base}.
@return the new instance.
clients/src/main/java/org/apache/kafka/common/utils/Utils.java