POO project in java with pattern design sate machine