Password extends AbstractSimpleDatatype<String> { @Override public String toString() { return "********"; } protected  Password();  Password(String value); @Override String toString(); static Password valueOf(String value);  }
@Test public void testEmpty() { String value = ""; Password empty = new Password(value); assertThat(empty).isEqualTo(new Password(value)); assertThat(empty.getValue()).isEqualTo(value); assertThat(AbstractSimpleDatatypeBase.getValue(empty)).isEqualTo(value); assertThat(empty.hashCode()).isEqualTo(value.hashCode()); assertThat(empty.toString()).isEqualTo("********"); }