code: public static GCRule buildGarbageCollectionRule(HColumnDescriptor columnDescriptor) {
      int maxVersions = columnDescriptor.getMaxVersions();
      int minVersions = columnDescriptor.getMinVersions();
      int ttlSeconds = columnDescriptor.getTimeToLive();
  
      Preconditions.checkState(minVersions < maxVersions,
          "HColumnDescriptor min versions must be less than max versions.");
  
      if (ttlSeconds == HColumnDescriptor.DEFAULT_TTL) {
        if (maxVersions == Integer.MAX_VALUE) {
          return null;
        } else {
          return GCRULES.maxVersions(maxVersions);
        }
      }
  
      // minVersions only comes into play with a TTL:
      GCRule ageRule = GCRULES.maxAge(Duration.ofSeconds(ttlSeconds));
      if (minVersions != HColumnDescriptor.DEFAULT_MIN_VERSIONS) {
        // The logic here is: only delete a cell if:
        //  1) the age is older than :ttlSeconds AND
        //  2) the cell's relative version number is greater than :minVersions
        //
        // Bigtable's nomenclature for this is:
        // Intersection (AND)
        //    - maxAge = :HBase_ttlSeconds
        //    - maxVersions = :HBase_minVersion
        ageRule = GCRULES.intersection().rule(ageRule).rule(GCRULES.maxVersions(minVersions));
      }
      if (maxVersions == Integer.MAX_VALUE) {
        return ageRule;
      } else {
        return GCRULES.union().rule(ageRule).rule(GCRULES.maxVersions(maxVersions));
      }
    }
docs: Construct an Bigtable {@link GCRule} from the given column descriptor.
  
  @param columnDescriptor a {@link org.apache.hadoop.hbase.HColumnDescriptor} object.
  @return a {@link GCRule} object.