class Numbers {

    public static int safeCastLongToInt( long value )
    {
        if ( (int) value != value )
        {
            throw new ArithmeticException( getOverflowMessage( value, Integer.TYPE ) );
        }
        return (int) value;
    }

}