public static Integer parseInteger(Object object, Integer defaultValue) {
return object == null ? defaultValue :
new BigDecimal(String.valueOf(object)).setScale(0, RoundingMode.HALF_UP).intValue();
}

下記呼び出しでぬるぽになるのはなんでなんだってばよ

System.out.println(parseInteger("5.4", null));// 5
System.out.println(parseInteger("5.5", null));// 6
System.out.println(parseInteger(null, 100));// 100
System.out.println(parseInteger(null, null));// ぬるぽ