equalsButNotSameAs function

Matcher equalsButNotSameAs(
  1. Object? other
)

A matcher that checks if two objects are equal but not the same instance.

Implementation

Matcher equalsButNotSameAs(Object? other) =>
    allOf(equals(other), isNot(same(other)));