public static DateTimeObject timeAdd(DateTimeObject t1, DateTimeObject t2) {
    { Surrogate testValue000 = Stella_Object.safePrimaryType(t1);

      if (Surrogate.subtypeOfP(testValue000, Stella.SGT_STELLA_CALENDAR_DATE)) {
        { CalendarDate t1000 = ((CalendarDate)(t1));

          { Surrogate testValue001 = Stella_Object.safePrimaryType(t2);

            if (Surrogate.subtypeOfP(testValue001, Stella.SGT_STELLA_CALENDAR_DATE)) {
              { CalendarDate t2000 = ((CalendarDate)(t2));

                { OutputStringStream stream000 = OutputStringStream.newOutputStringStream();

                  stream000.nativeStream.print("You can't add two calendar dates: `" + t1000 + "'  `" + t2000 + "'");
                  throw ((StellaException)(StellaException.newStellaException(stream000.theStringReader()).fillInStackTrace()));
                }
              }
            }
            else if (Surrogate.subtypeOfP(testValue001, Stella.SGT_STELLA_TIME_DURATION)) {
              { TimeDuration t2000 = ((TimeDuration)(t2));

                return (CalendarDate.makeCalendarDate(t1000.modifiedJulianDay + t2000.days, t1000.timeMillis + t2000.millis));
              }
            }
            else {
              { OutputStringStream stream001 = OutputStringStream.newOutputStringStream();

                stream001.nativeStream.print("`" + testValue001 + "' is not a valid case option");
                throw ((StellaException)(StellaException.newStellaException(stream001.theStringReader()).fillInStackTrace()));
              }
            }
          }
        }
      }
      else if (Surrogate.subtypeOfP(testValue000, Stella.SGT_STELLA_TIME_DURATION)) {
        { TimeDuration t1000 = ((TimeDuration)(t1));

          { Surrogate testValue002 = Stella_Object.safePrimaryType(t2);

            if (Surrogate.subtypeOfP(testValue002, Stella.SGT_STELLA_CALENDAR_DATE)) {
              { CalendarDate t2000 = ((CalendarDate)(t2));

                return (CalendarDate.makeCalendarDate(t1000.days + t2000.modifiedJulianDay, t1000.millis + t2000.timeMillis));
              }
            }
            else if (Surrogate.subtypeOfP(testValue002, Stella.SGT_STELLA_TIME_DURATION)) {
              { TimeDuration t2000 = ((TimeDuration)(t2));

                return (TimeDuration.makeTimeDuration(t1000.days + t2000.days, t1000.millis + t2000.millis));
              }
            }
            else {
              { OutputStringStream stream002 = OutputStringStream.newOutputStringStream();

                stream002.nativeStream.print("`" + testValue002 + "' is not a valid case option");
                throw ((StellaException)(StellaException.newStellaException(stream002.theStringReader()).fillInStackTrace()));
              }
            }
          }
        }
      }
      else {
        { OutputStringStream stream003 = OutputStringStream.newOutputStringStream();

          stream003.nativeStream.print("`" + testValue000 + "' is not a valid case option");
          throw ((StellaException)(StellaException.newStellaException(stream003.theStringReader()).fillInStackTrace()));
        }
      }
    }
  }