Here you can find the source of cast(long value)
public static int cast(long value)
//package com.java2s; //License from project: Open Source License public class Main { public static int cast(long value) { return value > Integer.MAX_VALUE ? Integer.MAX_VALUE : value < Integer.MIN_VALUE ? Integer.MIN_VALUE : (int) value; }/*from w ww .java2 s . c o m*/ }