Class diagram and state transition