Implement Subject.toString().
The inherited implementation throws UnsupportedOperationException because it calls hashCode() (and not identityHashCode() as I would have guessed).
It's been this way since we chose to override hashCode(); I just happened to get bit today when trying to use toString() to debug something.
RELNOTES=n/a
@@ -513,6 +513,11 @@ public class Subject<S extends Subject<S, T>, T> {
throw new UnsupportedOperationException("Subject.hashCode() is not supported.");
}
+ @Override
+ public String toString() {
+ return getClass().getName() + "(" + actualCustomStringRepresentation() + ")";
+ }
+
private static boolean classMetadataUnsupported() {
// https://github.com/google/truth/issues/198
// TODO(cpovirk): Consider whether to remove instanceof tests under GWT entirely.
