code: public void transitiveClosure() {
          IntBitRelation next;
  
          while (true) {
              next = new IntBitRelation(getMax());
              next.composeRightLeft(this, this);
              if (contains(next)) {
                  return;
              }
              addAll(next);
          }
      }
docs: Transitive closure.