public CompilerConfiguration applyCustomization(final CompilerConfiguration compilerConfiguration) {
        final Class<CompilerConfiguration> clazz = CompilerConfiguration.class;
        final List<Method> methods = Arrays.asList(clazz.getMethods());
        for (Map.Entry<String,Object> entry : properties.entrySet()) {
            final Method method = methods.stream().filter(m -> m.getName().equals("set" + entry.getKey())).findFirst()
                   .orElseThrow(() -> new IllegalStateException("Invalid setting [" + entry.getKey() + "] for CompilerConfiguration"));

            try {
                method.invoke(compilerConfiguration, entry.getValue());
            } catch (Exception ex) {
                throw new IllegalStateException(ex);
            }
        }

        return compilerConfiguration;
    }
Creates a new instance using configuration values specified
gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/ConfigurationGroovyCustomizer.java