if (cls != null) {
MetaClassRegistry registry = GroovySystem.getMetaClassRegistry();
registry.removeMetaClass(cls);
ExpandoMetaClass newMc = new ExpandoMetaClass(cls, true, true);
newMc.initialize();
registry.setMetaClass(cls, newMc);
Enhanced en = AnnotationUtils.findAnnotation(cls,Enhanced.class);
if (en != null) {
Class<?>[] mixinClasses = en.mixins();