How to convert a Long value into an Integer value in Java?
Assuming not null longVal
Integer intVal = ((Number)longVal).intValue();
It works for example y you get an Object that can be an Integer or a Long. I know that is ugly, but it happens...