class RegisteredTransformersRecord {
        Pattern pattern;
        List<HaClassFileTransformer> transformerList = new LinkedList<>();
    }

    protected Map<String, RegisteredTransformersRecord> redefinitionTransformers = new LinkedHashMap<>();
    protected Map<String, RegisteredTransformersRecord> otherTransformers = new LinkedHashMap<>();

    // keep track about which classloader requested which transformer
    protected Map<ClassFileTransformer, ClassLoader> classLoaderTransformers = new LinkedHashMap<>();

    protected Map<ClassLoader, Boolean> seenClassLoaders = new WeakHashMap<>();
    private List<Pattern> includedClassLoaderPatterns;
    private List<Pattern> excludedClassLoaderPatterns;
    public List<Pattern> getIncludedClassLoaderPatterns() {
        return includedClassLoaderPatterns;
    }

    public void setIncludedClassLoaderPatterns(List<Pattern> includedClassLoaderPatterns) {
        this.includedClassLoaderPatterns = includedClassLoaderPatterns;
    }


    /**
     * @param excludedClassLoaderPatterns
     *            the excludedClassLoaderPatterns to set
     */
    public void setExcludedClassLoaderPatterns(List<Pattern> excludedClassLoaderPatterns) {
        this.excludedClassLoaderPatterns = excludedClassLoaderPatterns;
    }

    public List<Pattern> getExcludedClassLoaderPatterns() {
        return excludedClassLoaderPatterns;
    }

    /**
     * Register a transformer for a regexp matching class names.
     * Used by {@link org.hotswap.agent.annotation.OnClassLoadEvent} annotation respective
     * {@link org.hotswap.agent.annotation.handler.OnClassLoadedHandler}.
     *
     * @param classLoader the classloader to which this transformation is associated
     * @param classNameRegexp regexp to match fully qualified class name.
     *                        Because "." is any character in regexp, this will match / in the transform method as well
     *                        (diffentence between java/lang/String and java.lang.String).
     * @param transformer     the transformer to be called for each class matching regexp.
     */
    public void registerTransformer(ClassLoader classLoader, String classNameRegexp, HaClassFileTransformer transformer) {
        LOGGER.debug("Registering transformer for class regexp '{}'.", classNameRegexp);

        String normalizeRegexp = normalizeTypeRegexp(classNameRegexp);

        Map<String, RegisteredTransformersRecord> transformersMap = getTransformerMap(transformer);

        RegisteredTransformersRecord transformerRecord = transformersMap.get(normalizeRegexp);
        if (transformerRecord == null) {
            transformerRecord = new RegisteredTransformersRecord();
            transformerRecord.pattern = Pattern.compile(normalizeRegexp);
            transformersMap.put(normalizeRegexp, transformerRecord);
        }

        if (!transformerRecord.transformerList.contains(transformer)) {
            transformerRecord.transformerList.add(transformer);
        }

        // register classloader association to allow classloader unregistration
        if (classLoader != null) {
            classLoaderTransformers.put(transformer, classLoader);
        }
    }

    private Map<String, RegisteredTransformersRecord> getTransformerMap(HaClassFileTransformer transformer) {
        if (transformer.isForRedefinitionOnly()) {
            return redefinitionTransformers;
        }
        return otherTransformers;
    }

    /**
     * Remove registered transformer.
     *
     * @param classNameRegexp regexp to match fully qualified class name.
     * @param transformer     currently registered transformer
     */
    public void removeTransformer(String classNameRegexp, HaClassFileTransformer transformer) {
        String normalizeRegexp = normalizeTypeRegexp(classNameRegexp);
        Map<String, RegisteredTransformersRecord> transformersMap = getTransformerMap(transformer);
        RegisteredTransformersRecord transformerRecord = transformersMap.get(normalizeRegexp);
        if (transformerRecord != null) {
            transformerRecord.transformerList.remove(transformer);
        }
    }

    /**
     * Remove all transformers registered with a classloader
     * @param classLoader
     */
    public void closeClassLoader(ClassLoader classLoader) {<FILL_FUNCTION_BODY>

        for (Iterator<Map.Entry<ClassFileTransformer, ClassLoader>> entryIterator = classLoaderTransformers.entrySet().iterator();
                entryIterator.hasNext(); ) {
            Map.Entry<ClassFileTransformer, ClassLoader> entry = entryIterator.next();
            if (entry.getValue().equals(classLoader)) {
                entryIterator.remove();
                for (RegisteredTransformersRecord transformerRecord : redefinitionTransformers.values()) {
                    transformerRecord.transformerList.remove(entry.getKey());
                }
                for (RegisteredTransformersRecord transformerRecord : otherTransformers.values()) {
                    transformerRecord.transformerList.remove(entry.getKey());
                }
            }
        }

        LOGGER.debug("All transformers removed for classLoader {}", classLoader);
    
<no_super_class>