State Pattern example in Java