### Question:
ValueType extends TypedString<ValueType> { @FromString public static ValueType of(String name) { return new ValueType(name); } 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 test_validation() { assertThatIllegalArgumentException().isThrownBy(() -> ValueType.of(null)); assertThatIllegalArgumentException().isThrownBy(() -> ValueType.of("")); assertThatIllegalArgumentException() .isThrownBy(() -> ValueType.of("Foo Bar")) .withMessageMatching(".*must only contain the characters.*"); assertThatIllegalArgumentException() .isThrownBy(() -> ValueType.of("Foo_Bar")) .withMessageMatching(".*must only contain the characters.*"); assertThatIllegalArgumentException() .isThrownBy(() -> ValueType.of("FooBar!")) .withMessageMatching(".*must only contain the characters.*"); ValueType.of("FooBar"); ValueType.of("Foo-Bar"); ValueType.of("123"); ValueType.of("FooBar123"); }
@Test public void coverage() { ValueType test = ValueType.of("Foo"); assertThat(test.toString()).isEqualTo("Foo"); assertSerialization(test); assertJodaConvert(ValueType.class, test); }