public void SetComparer_SequenceEqualTests() { List <T> objects = new List <T>() { CreateT(1), CreateT(2), CreateT(3), CreateT(4), CreateT(5), CreateT(6) }; var set = new SegmentedHashSet <SegmentedHashSet <T> >() { new SegmentedHashSet <T> { objects[0], objects[1], objects[2] }, new SegmentedHashSet <T> { objects[3], objects[4], objects[5] } }; var noComparerSet = new SegmentedHashSet <SegmentedHashSet <T> >() { new SegmentedHashSet <T> { objects[0], objects[1], objects[2] }, new SegmentedHashSet <T> { objects[3], objects[4], objects[5] } }; var comparerSet = new SegmentedHashSet <SegmentedHashSet <T> >(SegmentedHashSet <T> .CreateSetComparer()) { new SegmentedHashSet <T> { objects[0], objects[1], objects[2] }, new SegmentedHashSet <T> { objects[3], objects[4], objects[5] } }; Assert.False(noComparerSet.SequenceEqual(set)); Assert.True(noComparerSet.SequenceEqual(set, SegmentedHashSet <T> .CreateSetComparer())); Assert.False(comparerSet.SequenceEqual(set)); }