### Question:
JcrValue implements Value, org.modeshape.jcr.api.Value { public String getString() throws ValueFormatException { try { String convertedValue = valueFactories.getStringFactory().create(value); return convertedValue; } catch (RuntimeException error) { throw createValueFormatException(String.class); } } JcrValue( ValueFactories valueFactories,
              SessionCache sessionCache,
              int type,
              Object value );   JcrValue( ValueFactories valueFactories,
              SessionCache sessionCache,
              Value value ); boolean getBoolean(); Calendar getDate(); @Override BigDecimal getDecimal(); double getDouble(); long getLong(); InputStream getStream(); javax.jcr.Binary getBinary(); String getString(); int getType(); @Override int hashCode(); @Override boolean equals( Object obj ); @Override String toString();  }### Answer:
@Test public void shouldProvideStringForBoolean() throws Exception { assertThat(value.getString(), is("true")); }
@Test public void shouldProvideStringForDate() throws Exception { Calendar date = Calendar.getInstance(); date.set(2008, 7, 18, 12, 0, 0); date.set(Calendar.MILLISECOND, 0); String expectedValue = "2008-08-18T12:00:00.000"; assertThat(new JcrValue(factories, cache, PropertyType.DATE, date).getString().substring(0, expectedValue.length()), is(expectedValue)); assertThat(new JcrValue(factories, cache, PropertyType.DATE, date.getTime()).getString() .substring(0, expectedValue.length()), is(expectedValue)); }
@Test public void shouldProvideStringForDouble() throws Exception { assertThat(new JcrValue(factories, cache, PropertyType.DOUBLE, 1.0).getString(), is("1.0")); }
@Test public void shouldProvideStringForLong() throws Exception { assertThat(new JcrValue(factories, cache, PropertyType.LONG, 1L).getString(), is("1")); }
@Test public void shouldProvideStringForString() throws Exception { assertThat(new JcrValue(factories, cache, PropertyType.STRING, "true").getString(), is("true")); }
@Test public void shouldProvideStringForUuid() throws Exception { String expectedValue = "40d373f7-75ad-4d84-900e-c72ebd98abb9"; assertThat(new JcrValue(factories, cache, PropertyType.STRING, UUID.fromString(expectedValue)).getString(), is(expectedValue)); }