sbool containsPairOrReversedPair(Collection l, S a, S b) { ret contains(l, pair(a, b)) || contains(l, pair(b, a)); }