Add a test that the optimization is applied and works.