Implement a method for converting a Long value to int (primitive type) according to the following rules:
- if the given value is
nullthe method should return the default value for ints; - if the given value is greater than
Integer.MAX_VALUEthe method should return the max value for ints; - if the given value is lesser than
Integer.MIN_VALUEthe method should return the min value for ints; - otherwise, the method should return the same value as the passed argument.