VAT implements ValueObject { public double toDouble() { return percentage / 100d; } @JsonCreator  VAT(int percentage); static VAT valueOf(Integer percentage); @JsonValue int toInteger(); double toDouble(); @NonNull Money addTax(@NonNull Money amount); @NonNull Money subtractTax(@NonNull Money amount); @NonNull Money calculateTax(@NonNull Money amount); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }
@Test public void toDouble_returnedAsFraction() { assertThat(new VAT(24).toDouble()).isEqualTo(0.24); }