public static int checkedCast(final long value) {
        final int result = (int) value;
        Requires.requireTrue(result == value, "out of range: " + value);
        return result;
    }
Returns the {@code int} value that is equal to {@code value}, if possible.
jraft-core/src/main/java/com/alipay/sofa/jraft/util/Ints.java