State pattern example for OO training.