Generic Interfaces could be helpful, that allow alternative toString() behavior, e.g.
interface Printable {
A getA();
B getB();
@ToString
default String display() {
return getA() + ":" + getB();
}
}
assertThat(xray(obj).to(Printable.class).toString(), equalTo("<A.toString()>:<B.toString()>"))
Similar for equals(Object) behavior.
Generic Interfaces could be helpful, that allow alternative
toString()behavior, e.g.Similar for
equals(Object)behavior.