@Override
    public CompilationCustomizer create() {
        final org.codehaus.groovy.control.customizers.ImportCustomizer ic = new org.codehaus.groovy.control.customizers.ImportCustomizer();

        // there's something weird in groovy about doing specific imports instead of wildcard imports. with wildcard
        // imports groovy seems to allow methods to be overloaded with enums such that things like Column.values and
        // __.values() can be resolved by the compiler. if they are both directly in the imports then one or the other
        // can't be found. the temporary fix is to hardcode a wildcard import __ and then filter out the core imports
        // from the incoming customizer. ultimately, the fix should be to resolve the naming conflicts to ensure a
        // unique space somehow.
        ic.addStaticStars(__.class.getCanonicalName());
        for (ImportCustomizer customizer : customizers) {
            customizer.getClassImports().forEach(i -> ic.addImports(i.getCanonicalName()));
            customizer.getMethodImports().stream()
                    .filter(m -> !m.getDeclaringClass().equals(__.class))
                    .forEach(m -> ic.addStaticImport(m.getDeclaringClass().getCanonicalName(), m.getName()));
            customizer.getEnumClasses().forEach(m -> ic.addStaticStars(m.getCanonicalName())); // TINKERPOP-2953
            customizer.getFieldImports().forEach(f -> ic.addStaticImport(f.getDeclaringClass().getCanonicalName(), f.getName()));
        }

        return ic;
    }
@author Stephen Mallette (http://stephen.genoprime.com)
gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/ImportGroovyCustomizer.java