class TimeSpan implements Comparable<TimeSpan>, Serializable, TimeSpanProvider, SizeProvider {

    public TimeSpan plus(Duration dur)
    {
        if (dur.isZero())
        {
            return this;
        }
        else if (dur.isConvertibleTo(Milliseconds.class))
        {
            long durMillis = Duration.create(Milliseconds.class, dur).longValue();
            return TimeSpan.get(getStart() + durMillis, getEnd() + durMillis);
        }
        else
        {
            Calendar cal = Calendar.getInstance();
            cal.setTimeInMillis(getStart());
            dur.addTo(cal);
            long start = cal.getTimeInMillis();
            cal.setTimeInMillis(getEnd());
            dur.addTo(cal);
            long end = cal.getTimeInMillis();
            return get(start, end, dur);
        }
    }

}