ValueWithDisplayString { @Override public boolean equals(Object other) { if (!(other instanceof ValueWithDisplayString)) { return false; } ValueWithDisplayString value = (ValueWithDisplayString)other; return Objects.equals(myValue, value.myValue) && Objects.equals(myDisplayString, value.myDisplayString) && Objects.equals(myHint, value.myHint); } ValueWithDisplayString(@Nullable String displayString, @Nullable String value);  ValueWithDisplayString(@Nullable String displayString, @Nullable String value, @Nullable String hint);  ValueWithDisplayString(@Nullable String displayString,
                                @Nullable String value,
                                @Nullable String hint,
                                @Nullable ValueSelector selector); @Override @NotNull String toString(); @NotNull String getDisplayString(); @Nullable String getValue(); @Nullable String getHint(); @Nullable ValueSelector getValueSelector(); void setUseValueForToString(boolean useValueForToString); @Override int hashCode(); @Override boolean equals(Object other); static final ValueWithDisplayString SEPARATOR; static final ValueWithDisplayString UNSET; }
@Test public void testEquals() { assertThat(new ValueWithDisplayString("display", "value")).isEqualTo(new ValueWithDisplayString("display", "value")); assertThat(new ValueWithDisplayString("display", "value")).isNotEqualTo(new ValueWithDisplayString("display", "value", "hint")); assertThat(new ValueWithDisplayString("display", "value")).isNotEqualTo(new ValueWithDisplayString("different", "value")); assertThat(new ValueWithDisplayString("display", "value")).isNotEqualTo(new ValueWithDisplayString("display", "other")); assertThat(new ValueWithDisplayString("display", "value")).isNotEqualTo(new Object()); assertThat(new ValueWithDisplayString("display", "value")).isNotEqualTo(null); }