How to convert a Long value into an Integer value in Java?
If you care to check for overflows and have Guava handy, there is Ints.checkedCast():
int theInt = Ints.checkedCast(theLong);
The implementation is dead simple, and throws IllegalArgumentException on overflow:
public static int checkedCast(long value) {
int result = (int) value;
checkArgument(result == value, "Out of range: %s", value);
return result;
}