this.theClass = theClass;
theCachedClass = ReflectionCache.getCachedClass(theClass);
this.isGroovyObject = GroovyObject.class.isAssignableFrom(theClass);
this.isMap = Map.class.isAssignableFrom(theClass);
this.registry = GroovySystem.getMetaClassRegistry();
metaMethodIndex = new MetaMethodIndex(theCachedClass);
final MetaMethod[] metaMethods = theCachedClass.getNewMetaMethods();
if (add != null && !(add.length == 0)) {
ArrayList<MetaMethod> arr = new ArrayList<MetaMethod>();
arr.addAll(Arrays.asList(metaMethods));
arr.addAll(Arrays.asList(add));