private <T> T newPlugin(Class<T> klass) {
        // KAFKA-8340: The thread classloader is used during static initialization and must be
        // set to the plugin's classloader during instantiation
        try (LoaderSwap loaderSwap = withClassLoader(klass.getClassLoader())) {
            return Utils.newInstance(klass);
        } catch (Throwable t) {
            throw new ConnectException("Instantiation error", t);
        }
    }
@Test
    public void shouldThrowIfPluginMissingSuperclass() {
        assertThrows(ConnectException.class, () -> plugins.newPlugin(
                TestPlugin.BAD_PACKAGING_MISSING_SUPERCLASS.className(),
                new AbstractConfig(new ConfigDef(), Collections.emptyMap()),
                Converter.class
        ));
    }