Add test for class change style invalidation optimization