@Test
public void castToBoolean() {

    assertTrue(TypeUtils.castToBoolean(Boolean.TRUE));
    assertTrue(TypeUtils.castToBoolean("TRUE"));
    assertTrue(TypeUtils.castToBoolean("true"));
    assertFalse(TypeUtils.castToBoolean(Boolean.FALSE));
    assertFalse(TypeUtils.castToBoolean("FALSE"));
    assertFalse(TypeUtils.castToBoolean("false"));
    assertTrue(TypeUtils.castToBoolean(null, true));
    assertFalse(TypeUtils.castToBoolean(null, false));
    assertTrue(TypeUtils.castToBoolean(true, true));
    assertTrue(TypeUtils.castToBoolean(true, false));
}