code: public void expandToQueue( PriorityQueue priQ, double minDistance ) {
          boolean isComp1 = isComposite(boundable1);
          boolean isComp2 = isComposite(boundable2);
  
          /**
           * HEURISTIC: If both boundable are composite,
           * choose the one with largest area to expand.
           * Otherwise, simply expand whichever is composite.
           */
          if (isComp1 && isComp2) {
              if (area(boundable1) > area(boundable2)) {
                  expand(boundable1, boundable2, priQ, minDistance);
                  return;
              } else {
                  expand(boundable2, boundable1, priQ, minDistance);
                  return;
              }
          } else if (isComp1) {
              expand(boundable1, boundable2, priQ, minDistance);
              return;
          } else if (isComp2) {
              expand(boundable2, boundable1, priQ, minDistance);
              return;
          }
  
          throw new IllegalArgumentException("neither boundable is composite");
      }
docs: For a pair which is not a leaf
  (i.e. has at least one composite boundable)
  computes a list of new pairs
  from the expansion of the larger boundable.