### Question:
JcrValue implements Value, org.modeshape.jcr.api.Value { public double getDouble() throws ValueFormatException { try { double convertedValue = valueFactories.getDoubleFactory().create(value); return convertedValue; } catch (RuntimeException error) { throw createValueFormatException(double.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( expected = ValueFormatException.class ) public void shouldNotProvideDoubleForBoolean() throws Exception { value.getDouble(); }
@Test public void shouldProvideDoubleForDate() throws Exception { Date date = new Date(); assertThat(new JcrValue(factories, cache, PropertyType.DATE, date).getDouble(), is((double)date.getTime())); }
@Test public void shouldProvideDoubleForDouble() throws Exception { assertThat(new JcrValue(factories, cache, PropertyType.DOUBLE, 1.2).getDouble(), is(1.2)); }
@Test public void shouldProvideDoubleForLong() throws Exception { assertThat(new JcrValue(factories, cache, PropertyType.LONG, 1L).getDouble(), is(1.0)); }
@Test public void shouldProvideDoubleForString() throws Exception { assertThat(new JcrValue(factories, cache, PropertyType.STRING, "1").getDouble(), is(1.0)); }
@Test( expected = ValueFormatException.class ) public void shouldNotProvideDoubleForInvalidString() throws Exception { new JcrValue(factories, cache, PropertyType.STRING, "true").getDouble(); }
@Test( expected = ValueFormatException.class ) public void shouldNotProvideDoubleForUuid() throws Exception { new JcrValue(factories, cache, PropertyType.STRING, UUID.randomUUID()).getDouble(); }