BooleanValue extends ValueAdapter { @Override public abstract Boolean asObject(); private  BooleanValue(); static BooleanValue fromBoolean( boolean value ); @Override abstract Boolean asObject(); @Override Type type(); @Override int hashCode(); static BooleanValue TRUE; static BooleanValue FALSE; }
@Test void shouldConvertToBooleanAndObject() { assertTrue( TRUE.asBoolean()); assertFalse( BooleanValue.FALSE.asBoolean()); assertThat( TRUE.asObject(), equalTo( (Object) Boolean.TRUE )); assertThat( FALSE.asObject(), equalTo( (Object) Boolean.FALSE )); }