please include function holdInstance. static AutoCloseable 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 o; } null; }