code: long until(AbstractDate end, TemporalUnit unit) {
          if (unit instanceof ChronoUnit) {
              switch ((ChronoUnit) unit) {
                  case DAYS:
                      return daysUntil(end);
                  case WEEKS:
                      return weeksUntil(end);
                  case MONTHS:
                      return monthsUntil(end);
                  case YEARS:
                      return monthsUntil(end) / lengthOfYearInMonths();
                  case DECADES:
                      return monthsUntil(end) / (lengthOfYearInMonths() * 10);
                  case CENTURIES:
                      return monthsUntil(end) / (lengthOfYearInMonths() * 100);
                  case MILLENNIA:
                      return monthsUntil(end) / (lengthOfYearInMonths() * 1000);
                  case ERAS:
                      return end.getLong(ERA) - getLong(ERA);
                  default:
                      break;
              }
              throw new UnsupportedTemporalTypeException("Unsupported unit: " + unit);
          }
          return unit.between(this, end);
      }
docs: -------------------------------------------------------------------------