State Pattern Implementation in Java - Sample Code