State Diagram Example