code: public ColumnFamily diff(ColumnFamily cfComposite)
      {
          assert cfComposite.id().equals(id());
          ColumnFamily cfDiff = ArrayBackedSortedColumns.factory.create(metadata);
          cfDiff.delete(cfComposite.deletionInfo());
  
          // (don't need to worry about cfNew containing Columns that are shadowed by
          // the delete tombstone, since cfNew was generated by CF.resolve, which
          // takes care of those for us.)
          for (Cell cellExternal : cfComposite)
          {
              CellName cName = cellExternal.name();
              Cell cellInternal = getColumn(cName);
              if (cellInternal == null)
              {
                  cfDiff.addColumn(cellExternal);
              }
              else
              {
                  Cell cellDiff = cellInternal.diff(cellExternal);
                  if (cellDiff != null)
                  {
                      cfDiff.addColumn(cellDiff);
                  }
              }
          }
  
          cfDiff.setDeletionInfo(deletionInfo().diff(cfComposite.deletionInfo()));
  
          if (!cfDiff.isEmpty())
              return cfDiff;
          
          return null;
      }
docs: /*
  This function will calculate the difference between 2 column families.
  The external input is assumed to be a superset of internal.