Update User.java

Was previously throwing ClassCastException.