code: public GregorianCalendar getExpiredDate(GregorianCalendar relativeDate) {
          // Get today's date and adjust by the specified age.
          GregorianCalendar expiredDate = (GregorianCalendar)relativeDate.clone();
          switch (m_units) {
          case DAYS:
              expiredDate.add(Calendar.DAY_OF_MONTH, -m_value);
              break;
          case MONTHS:
              expiredDate.add(Calendar.MONTH, -m_value);
              break;
          case YEARS:
              expiredDate.add(Calendar.YEAR, -m_value);
              break;
          default:
              // New value we forgot to add here?
              throw new AssertionError("Unknown RetentionUnits: " + m_units);
          }
          return expiredDate;
      }
docs: Find the date on or before which objects expire based on the given date and the
  retention age specified in this object. The given date is cloned and then adjusted
  downward by the units and value in this RetentionAge.
  
  @param   relativeDate    Reference date.
  @return  The date relative to the given one at which objects should be considered
  expired based on this RetentionAge.