### Question:
Variable { public String asString() { return value != null && value instanceof String ? value.toString() : null; } 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 testAsString() throws Exception { assertNull("expected null", new Variable(null).asNumber()); Variable var = new Variable("Hello, world"); assertEquals("wrong value", "Hello, world", var.asString()); assertNull("asBoolean", var.asBoolean()); assertNull("asNumber", var.asNumber()); assertNotNull("asString", var.asString()); assertNull("asTimestamp", var.asTimestamp()); assertEquals("asBool", false, var.asBool()); assertEquals("asDouble", Double.valueOf(Double.NaN), Double.valueOf(var.asDouble())); assertEquals("asInt", Integer.MIN_VALUE, var.asInt()); }