Added basic state pattern example.