With Javassist, how can I create an absolutely the same class as the one I have, but with a different name. I want to preserve all runtime annotations as well.
ClassPool pool = ClassPool.getDefault();
CtClass cc = pool.get("OriginalName");
cc.setName("NewName");
cc.writeFile();