@Test
public void testValueOf() throws Exception {

    Map<String, Object> options = formatter.getDefaultOptions();
    Value boolVar = getVM().mirrorOf(true);
    Value newValue = formatter.valueOf("true", boolVar.type(), options);
    assertTrue("should return boolean type", newValue instanceof BooleanValue);
    assertTrue("should return boolean type", ((BooleanValue)newValue).value());
    assertEquals("Should be able to restore boolean value.", "true",
        formatter.toString(newValue, options));
    newValue = formatter.valueOf("True", boolVar.type(), options);
    assertTrue("should return boolean type", newValue instanceof BooleanValue);
    assertTrue("should return boolean type", ((BooleanValue)newValue).value());
    newValue = formatter.valueOf("false", boolVar.type(), options);
    assertTrue("should return boolean type", newValue instanceof BooleanValue);
    assertFalse("should return boolean 'false'", ((BooleanValue)newValue).value());
    newValue = formatter.valueOf("False", boolVar.type(), options);
    assertTrue("should return boolean type", newValue instanceof BooleanValue);
    assertFalse("should return boolean 'false'", ((BooleanValue)newValue).value());
    newValue = formatter.valueOf("abc", boolVar.type(), options);
    assertTrue("should return boolean type", newValue instanceof BooleanValue);
    assertFalse("should return boolean 'false'", ((BooleanValue)newValue).value());
}