please include function holdInstance. static A heldInstance(Class c) { L l = holdInstance_l!; for (int i = l(l)-1; i >= 0; i--) { O o = l.get(i); if (isInstanceOf(o, c)) ret (A) o; } fail("No instance of " + className(c) + " held"); }