VAT implements ValueObject { @JsonValue public int toInteger() { return percentage; } @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 toInteger_returnedAsPercent() { assertThat(new VAT(24).toInteger()).isEqualTo(24); }