State Design Pattern In Java