Java Applying switch Statements