When i change the outer wrapper to class public TicketMachine
the class diagram become red mesh.

After i try to compile it, it show some error. The first error, it said that it expect an identifier after class. So i change it back to erlier version. I think the error message is clear enough.
After that, the diagram become some grey slanted line. an can be compiled with no problem.