Here you can find the source of toBool(Boolean obj)
public static boolean toBool(Boolean obj)
//package com.java2s; //License from project: Apache License public class Main { public static boolean toBool(Long num) { if (num == null || num <= 0) { return false; } else {// ww w.j a v a2 s.com return true; } } public static boolean toBool(Boolean obj) { if (obj == null) { return false; } else { return obj; } } }