Fix the optimize regex and adapt the tests to actually test classAnnotationOptimize