ConstantPool cp = new ConstantPool();
ClassReader cr = new ClassReader(new FileInputStream(f));
ClassWriter cw = new ClassWriter(0);
ClassConstantsCollector ccc = new ClassConstantsCollector(cw, cp);
ClassOptimizer co = new ClassOptimizer(ccc, remapper);
cr.accept(co, ClassReader.SKIP_DEBUG);
Set<Constant> constants = new TreeSet<Constant>(
new ConstantComparator());
constants.addAll(cp.values());