Class RelationshipTester<T>

    • Field Detail

      • equivalence

        private final Equivalence<? super T> equivalence
        A word about using Equivalence, which automatically checks for null and identical inputs: This sounds like it ought to be a problem here, since the goals of this class include testing that equals() is reflexive and is tolerant of null. However, there's no problem. The reason: EqualsTester tests null and identical inputs directly against equals() rather than through the Equivalence.
      • relationshipName

        private final java.lang.String relationshipName
      • hashName

        private final java.lang.String hashName
    • Method Detail

      • addRelatedGroup

        public RelationshipTester<T> addRelatedGroup​(java.lang.Iterable<? extends T> group)
      • test

        public void test()
      • assertRelated

        private void assertRelated​(int groupNumber,
                                   int itemNumber,
                                   int relatedItemNumber)
      • assertUnrelated

        private void assertUnrelated​(int groupNumber,
                                     int itemNumber,
                                     int unrelatedGroupNumber,
                                     int unrelatedItemNumber)