if (other.folders.size() > 0) folders = fu.intersect(folders, other.folders);
folders = fu.intersectIfNonempty(folders, other.folders);
    public void andConstraints(DbSearchConstraints other)     {        if (noResults || other.noResults) {            noResults = true;            return;        }        MySetUtil<Tag> tu = new MySetUtil<Tag>();        MySetUtil<Folder> fu = new MySetUtil<Folder>();        MySetUtil<Integer> iu = new MySetUtil<Integer>();        MySetUtil<Byte> bu = new MySetUtil<Byte>();        // tags        tags = tu.union(tags, other.tags);        excludeTags = tu.union(excludeTags, other.excludeTags);        // has tags         if (hasTags == null)            hasTags = other.hasTags;        else if (other.hasTags != null) {            if (hasTags != other.hasTags) {                noResults = true;                ZimbraLog.index.debug("Adding a HAS_NO_TAGS constraint to a HAS_TAGS one, this is a NO_RESULTS result");                return;            }        }        // folders        //        // these we have to intersect:        //        //   Folder{A or B or C} AND Folder{B or C or D} --> Folder{IN-BOTH}        if (other.folders.size() > 0)            folders = fu.intersect(folders, other.folders);                excludeFolders = fu.union(excludeFolders, other.excludeFolders);        // convId        if (other.convId != 0) {            if (convId != 0) {                 if (convId != other.convId) {                    ZimbraLog.index.debug("ANDING a constraint with incompatible convIds, this is a NO_RESULTS constraint now");                    noResults = true;                }            } else {                convId = other.convId;            }        }        prohibitedConvIds = iu.union(prohibitedConvIds, other.prohibitedConvIds);        // itemId        // these we have to intersect:        //        //   Item{A or B or C} AND Item{B or C or D} --> Item{IN-BOTH}        if (other.itemIds.size() > 0)            itemIds = iu.intersect(itemIds, other.itemIds);        // these we can just union, since:        //        // -Item{A or B} AND -Item{C or D} -->         //   (-Item(A) AND -Item(B)) AND (-C AND -D) -->        //     (A AND B AND C AND D)        prohibitedItemIds = iu.union(prohibitedItemIds, other.prohibitedItemIds);        // indexId        //   IndexId{A or B or C} AND IndexId{B or C or D} --> IndexId{IN-BOTH}        if (other.indexIds.size() > 0)            indexIds = iu.intersect(indexIds, other.indexIds);        // types        // see comments above        if (other.types.size() > 0)            types = bu.intersect(types, other.types);                // see comments above        excludeTypes = bu.union(excludeTypes, other.excludeTypes);        // dates        if (other.dates != null) {            if (dates == null)                 dates = new ArrayList<Range>();            dates.addAll(other.dates);        }        // modified        if (other.modified != null) {            if (modified == null)                 modified = new ArrayList<Range>();            modified.addAll(other.modified);        }        // sizes        if (other.sizes!= null) {            if (sizes == null)                 sizes = new ArrayList<Range>();            sizes.addAll(other.sizes);        }    }