Here you can find the source of castBoolean(Object inObject)
public static Boolean castBoolean(Object inObject)
//package com.java2s; //License from project: Open Source License public class Main { public static Boolean castBoolean(Object inObject) { return castBoolean(inObject, null); }//from w ww.ja v a2s. c om public static Boolean castBoolean(Object inObject, Boolean inDefault) { try { return (Boolean) inObject; } catch (final Exception e) { return inDefault; } } }