@Test
public void testValueOf() throws Exception {

    Map<String, Object> options = formatter.getDefaultOptions();
    Value string = this.getLocalValue("str");
    StringReference newValue = (StringReference) formatter.valueOf("aaa", string.type(), options);
    assertNotNull("StringObjectFormatter should be able to create string.", newValue);
    assertEquals("Should create a String with right value.", "aaa", newValue.value());
    newValue = (StringReference) formatter.valueOf("\"aaa\"", string.type(), options);
    assertNotNull("StringObjectFormatter should be able to create string.", newValue);
    assertEquals("Should create a String with right value.", "aaa", newValue.value());
    newValue = (StringReference) formatter.valueOf("\"aaa", string.type(), options);
    assertNotNull("StringObjectFormatter should be able to create string.", newValue);
    assertEquals("Should create a String with right value.", "\"aaa", newValue.value());
    assertNull("StringObjectFormatter should be able to create null string.",
        formatter.valueOf("null", string.type(), options));
    assertNull("StringObjectFormatter should be able to create null string.",
        formatter.valueOf(null, string.type(), options));
}