Build with JDK7, replace if with switch