code: private static void convertGarbageCollectionRule(GcRule gcRule,
        HColumnDescriptor columnDescriptor) {
  
      // The Bigtable default is to have infinite versions.
      columnDescriptor.setMaxVersions(Integer.MAX_VALUE);
      if (gcRule == null || gcRule.equals(GcRule.getDefaultInstance())) {
        return;
      }
      switch(gcRule.getRuleCase()) {
      case MAX_AGE:
        columnDescriptor.setTimeToLive((int) gcRule.getMaxAge().getSeconds());
        return;
      case MAX_NUM_VERSIONS:
        columnDescriptor.setMaxVersions(gcRule.getMaxNumVersions());
        return;
      case INTERSECTION: {
        // minVersions and maxAge are set.
        processIntersection(gcRule, columnDescriptor);
        return;
      }
      case UNION: {
        // (minVersion && maxAge) || maxVersions
        List<GcRule> unionRules = gcRule.getUnion().getRulesList();
        Preconditions.checkArgument(unionRules.size() == 2, "Cannot process rule " + gcRule);
        if (hasRule(unionRules, RuleCase.INTERSECTION)) {
          processIntersection(getRule(unionRules, RuleCase.INTERSECTION), columnDescriptor);
        } else {
          columnDescriptor
              .setTimeToLive((int) getRule(unionRules, RuleCase.MAX_AGE).getMaxAge().getSeconds());
        }
        columnDescriptor.setMaxVersions(getVersionCount(unionRules));
        return;
      }
      default:
        throw new IllegalArgumentException("Could not proess gc rules: " + gcRule);
      }
    }
docs: <p>
  Parse a Bigtable {@link GcRule} that is in line with
  {@link #buildGarbageCollectionRule(HColumnDescriptor)} into the provided
  {@link HColumnDescriptor}.
  </p>
  <p>
  This method will likely throw IllegalStateException or IllegalArgumentException if the GC Rule
  isn't similar to {@link #buildGarbageCollectionRule(HColumnDescriptor)}'s rule.
  </p>