code: public static MetaClass getMetaClass(Class c) {
          MetaClassRegistry metaClassRegistry = GroovySystem.getMetaClassRegistry();
          MetaClass mc = metaClassRegistry.getMetaClass(c);
          if (mc instanceof ExpandoMetaClass
                  || mc instanceof DelegatingMetaClass && ((DelegatingMetaClass) mc).getAdaptee() instanceof ExpandoMetaClass)
              return mc;
          else {
              return new HandleMetaClass(mc);
          }
      }
docs: Adds a "metaClass" property to all class objects so you can use the syntax
  <code>String.metaClass.myMethod = { println "foo" }</code>
  
  @param c The java.lang.Class instance
  @return An MetaClass instance
  @since 1.5.0