### Question:
ValueType extends TypedString<ValueType> { public void checkEquals(ValueType other, String exceptionPrefix) { if (!this.equals(other)) { throw new IllegalArgumentException(Messages.format( "{}, expected {} but was {}", exceptionPrefix, other, this)); } } private  ValueType(String name); @FromString static ValueType of(String name); void checkEquals(ValueType other, String exceptionPrefix); static final ValueType UNKNOWN; static final ValueType YEAR_FRACTION; static final ValueType MONTHS; static final ValueType ZERO_RATE; static final ValueType FORWARD_RATE; static final ValueType DISCOUNT_FACTOR; static final ValueType DIVIDEND_YIELD; static final ValueType PRICE_INDEX; static final ValueType RECOVERY_RATE; static final ValueType BLACK_VOLATILITY; static final ValueType NORMAL_VOLATILITY; static final ValueType LOCAL_VOLATILITY; static final ValueType PRICE; static final ValueType STRIKE; static final ValueType SIMPLE_MONEYNESS; static final ValueType LOG_MONEYNESS; static final ValueType SABR_ALPHA; static final ValueType SABR_BETA; static final ValueType SABR_RHO; static final ValueType SABR_NU; static final ValueType RISK_REVERSAL; static final ValueType STRANGLE; }### Answer:
@Test public void checkEquals() { ValueType test = ValueType.of("Foo"); test.checkEquals(test, "Error"); assertThatIllegalArgumentException().isThrownBy(() -> test.checkEquals(ValueType.PRICE_INDEX, "Error")); }