long firstEnd = mDtStart.add(mDuration).getUtcTime();
long firstEnd = mDuration != null ? mDtStart.add(mDuration).getUtcTime() : firstStart;
        public List<Instance> expandInstances(CalendarItem calItem, long start, long end)         {            if (mDtStart == null) {                ZimbraLog.calendar.warn("Unable to expand a recurrence with no DTSTART");                return new ArrayList<Instance>();            }            if (mAddRules == null) {                // trivial, just DtStart!                List<Instance> toRet = new ArrayList<Instance>(1);                long instStart = mDtStart.getUtcTime();                long instEnd = mDtStart.add(mDuration).getUtcTime();                if (instStart < end && instEnd > start) {                    toRet.add(new Instance(calItem, mInvId, false, instStart, instEnd, false));                }                return toRet;            }                        // start with the addrules            List<Instance> addRules = mAddRules.expandInstances(calItem, start, end);                        // subtract the SubRules            List<Instance> subRules;            if (mSubtractRules != null) {                subRules = mSubtractRules.expandInstances(calItem, start, end);            } else {                subRules = new ArrayList<Instance>();            }                                    List<Instance> toRet = (List<Instance>) ListUtil.subtractSortedLists(addRules, subRules);                                    // ALWAYS include DTSTART -- by spec            long firstStart = mDtStart.getUtcTime();            long firstEnd = mDtStart.add(mDuration).getUtcTime();            if (firstStart < end && firstEnd > start) {                CalendarItem.Instance first = null;                if (toRet.size() >0) {                    first = (CalendarItem.Instance)toRet.get(0);                }                                CalendarItem.Instance dtstartInst = new CalendarItem.Instance(calItem, mInvId, false, mDtStart.getUtcTime(), mDtStart.add(mDuration).getUtcTime(), false);                 if (first == null || first.compareTo(dtstartInst) != 0) {                    assert(first == null || first.compareTo(dtstartInst) > 0); // first MUST be after dtstart!                    toRet.add(0,dtstartInst);                }            }                            return toRet;        }