Java State Machine using enum