### Question:
PrimitiveOnlyValueWriter extends BaseToObjectValueWriter<RuntimeException> { public Object valueAsObject( AnyValue value ) { value.writeTo( this ); return value(); }  Object valueAsObject( AnyValue value ); Object sensitiveValueAsObject( AnyValue value ); @Override void writeByteArray( byte[] value ); @Override void writeDuration( long months, long days, long seconds, int nanos ); @Override void writeDate( LocalDate localDate ); @Override void writeLocalTime( LocalTime localTime ); @Override void writeTime( OffsetTime offsetTime ); @Override void writeLocalDateTime( LocalDateTime localDateTime ); @Override void writeDateTime( ZonedDateTime zonedDateTime );  }### Answer:
@Test void shouldConvertStringValueToString() { PrimitiveOnlyValueWriter writer = new PrimitiveOnlyValueWriter(); TextValue value = stringValue( "Hello" ); assertEquals( "Hello", writer.valueAsObject( value ) ); }
@Test void shouldConvertLongValueToLong() { PrimitiveOnlyValueWriter writer = new PrimitiveOnlyValueWriter(); LongValue value = longValue( 42 ); assertEquals( 42L, writer.valueAsObject( value ) ); }
@Test void shouldConvertMultipleValues() { PrimitiveOnlyValueWriter writer = new PrimitiveOnlyValueWriter(); TextValue value1 = stringValue( "Hello" ); TextValue value2 = stringValue( " " ); TextValue value3 = stringValue( "World!" ); LongValue value4 = longValue( 42 ); assertEquals( "Hello", writer.valueAsObject( value1 ) ); assertEquals( " ", writer.valueAsObject( value2 ) ); assertEquals( "World!", writer.valueAsObject( value3 ) ); assertEquals( 42L, writer.valueAsObject( value4 ) ); }