Name of State for debugging purposes.
This default implementation returns the class name, returning
the instance name would better in cases where a State class
is used for multiple states. But normally there is one class per
state and the class name is sufficient and easy to get. You may
want to provide a setName or some other mechanism for setting
another name if the class name is not appropriate.
String name = getClass().getName();
int lastDollar = name.lastIndexOf('$");
return name.substring(lastDollar + 1);