Here you can find the source of toInteger(BigDecimal b)
public static Long toInteger(BigDecimal b)
//package com.java2s; //License from project: Apache License import java.math.BigDecimal; public class Main { public static Long toInteger(BigDecimal b) { return b == null ? null : b.longValue(); }//from ww w . j a v a 2 s.com }