### Question:
Variable { public boolean asBool() { Boolean b = asBoolean(); return b != null ? b.booleanValue() : false; } Variable(Object theValue); Object asObject(); Boolean asBoolean(); boolean asBool(); double asDouble(); int asInt(); BigDecimal asNumber(); String asString(); Timestamp asTimestamp(); String toString();  }### Answer:
@Test public void testAsBool() throws Exception { assertEquals("asBool", false, new Variable(null).asBool()); Variable var = new Variable(Boolean.TRUE); assertEquals("wrong value", true, var.asBool()); var = new Variable("1"); assertEquals("wrong value", true, var.asBool()); var = new Variable("true"); assertEquals("wrong value", true, var.asBool()); assertNotNull("asBoolean", var.asBoolean()); assertNull("asNumber", var.asNumber()); assertNotNull("asString", var.asString()); assertNull("asTimestamp", var.asTimestamp()); assertEquals("asBool", true, var.asBool()); assertEquals("asDouble", Double.valueOf(Double.NaN), Double.valueOf(var.asDouble())); assertEquals("asInt", Integer.MIN_VALUE, var.asInt()); }