class TypeConverter {

    public static Boolean convertToBool(final Object value) {
        if (value instanceof Boolean) {
            return (Boolean) value;
        }
        if (value instanceof Number) {
            double val = ((Number) value).doubleValue();
            return val != 0 && !((Number) val).equals(Double.NaN);
        }
        if (value instanceof String) {
            return !((String) value).isEmpty();
        }
        if (value instanceof List) {
            return Boolean.TRUE;
        }
        return value != null;
    }

}