void CalendarRegressionTest::test4145983()
{
    UErrorCode status = U_ZERO_ERROR;
    GregorianCalendar *calendar = new GregorianCalendar(status);
    if(U_FAILURE(status)) {
      dataerrln("Error creating calendar %s", u_errorName(status));
      delete calendar;
      return;
    }
    calendar->adoptTimeZone(TimeZone::createTimeZone("GMT"));
    UDate DATES [] = { LATEST_SUPPORTED_MILLIS, EARLIEST_SUPPORTED_MILLIS };
    for (int32_t i=0; i<2; ++i) {
        calendar->setTime(DATES[i], status);
        int32_t year = calendar->get(UCAL_YEAR,status);
        int32_t maxYear = calendar->getMaximum(UCAL_YEAR);
        if (year > maxYear) {
            errln(UnicodeString("Failed for ")+DATES[i]+" ms: year=" +
                  year + ", maxYear=" + maxYear);
        }
    }

    delete calendar;
}
void CalendarRegressionTest::test4145983()
{
    UErrorCode status = U_ZERO_ERROR;
    GregorianCalendar *calendar = new GregorianCalendar(status);
    if(U_FAILURE(status)) {
      dataerrln("Error creating calendar %s", u_errorName(status));
      delete calendar;
      return;
    }
    calendar->adoptTimeZone(TimeZone::createTimeZone("GMT"));
    UDate DATES [] = { LATEST_SUPPORTED_MILLIS, EARLIEST_SUPPORTED_MILLIS };
    for (int32_t i=0; i<2; ++i) {
        calendar->setTime(DATES[i], status);
        int32_t year = calendar->get(UCAL_YEAR,status);
        int32_t maxYear = calendar->getMaximum(UCAL_YEAR);
        if (year > maxYear) {
            errln(UnicodeString("Failed for ")+DATES[i]+" ms: year=" +
                  year + ", maxYear=" + maxYear);
        }
    }

    delete calendar;
}