treats null values as empty sets

@param id a {@link QuotedID}
@param re1 a {@link RAExpressionAttributes}
@param re2 a {@link RAExpressionAttributes}
@return the union of occurrences of id in e1 and e2
10272
private static ImmutableSet<RelationID> attributeOccurrencesUnion(QuotedID id,
                                                                      RAExpressionAttributes re1,
                                                                      RAExpressionAttributes re2) {

        ImmutableSet<RelationID> s1 = re1.attributeOccurrences.get(id);
        ImmutableSet<RelationID> s2 = re2.attributeOccurrences.get(id);

        if (s1 == null)
            return s2;

        if (s2 == null)
            return s1;

        return ImmutableSet.<RelationID>builder().addAll(s1).addAll(s2).build();
    }
385169
public static String subscriptionFromResourceId(String id) {
        return (id != null) ? ResourceId.fromString(id).subscriptionId() : null;
    }
577888
private static void checkRelationAliasesConsistency(RAExpressionAttributes re1,
                                                        RAExpressionAttributes re2) throws IllegalJoinException {

        ImmutableSet<RelationID> alias1 = re1.attributes.keySet().stream()
                .filter(id -> id.getRelation() != null)
                .map(QualifiedAttributeID::getRelation).collect(ImmutableCollectors.toSet());

        ImmutableSet<RelationID> alias2 = re2.attributes.keySet().stream()
                .filter(id -> id.getRelation() != null)
                .map(QualifiedAttributeID::getRelation).collect(ImmutableCollectors.toSet());

        if (alias1.stream().anyMatch(alias2::contains))
            throw new IllegalJoinException(re1, re2 ,"Relation alias " +
                    alias1.stream().filter(alias2::contains).collect(ImmutableCollectors.toList()) +
                    " occurs in both arguments of the JOIN");
    }
1352424
public Integer getPreviousIDSeq(final String id) {
        Validate.notNull(id, "ID cannot be null");
        final Integer count = this.idCounts.get(id);
        if (count == null) {
            throw new TemplateProcessingException(
                    "Cannot obtain previous ID count for ID \"" + id + "\"");
        }
        return Integer.valueOf(count.intValue() - 1);
    }
362847
private final static String generateIDMonomerNotation(String id, String count, String annotation) {
		if (id.length() > 1) {
			id = "[" + id + "]";
		}
		String result = id;
		try {
			if (!(Integer.parseInt(count) == 1)) {
				result += "'" + count + "'";
			}
		} catch (NumberFormatException e) {
			result += "'" + count + "'";
		}
		if (annotation != null) {
			result += "\"" + annotation + "\"";
		}
		return result;
	}
377046
public Integer getNextIDSeq(final String id) {
        Validate.notNull(id, "ID cannot be null");
        Integer count = this.idCounts.get(id);
        if (count == null) {
            count = Integer.valueOf(1);
        }
        return count;
    }
1013255
public T getById(String id) throws NRE {
        T rule = rules.get(id);

        if (null == rule) {
            throw newNoRuleException(id);
        }

        return rule;
    }
850171
private String ifNull(int rowIndex){

        if(params.length != 2){
            throw new IllegalArgumentException("Wrong number of Parameters for if null expression");
        }

        final RecordList.Record currentRecord = recordList.getRecords().get(rowIndex);
        final String field1 = currentRecord.getValueByFieldName(params[0]);

        if (!field1.isEmpty()){
            return field1;
        }
        final String field2 = currentRecord.getValueByFieldName(params[1]);
        return field2;
    }
1252828
private Set<String> getRelatedElementIds(String id) {

        Set<String> result = new HashSet<String>();
        if (id != null) {
            result.add(id);
            String serverId = getServerId(id);

            Iterator<String> it = m_elements.keySet().iterator();
            while (it.hasNext()) {
                String elId = it.next();
                if (elId.startsWith(serverId)) {
                    result.add(elId);
                }
            }

            Iterator<org.opencms.ade.containerpage.client.ui.CmsContainerPageElementPanel> itEl = getAllDragElements().iterator();
            while (itEl.hasNext()) {
                org.opencms.ade.containerpage.client.ui.CmsContainerPageElementPanel element = itEl.next();
                if (element.getId().startsWith(serverId)) {
                    result.add(element.getId());
                }
            }
        }
        return result;
    }
975977
public static String getCollation(final int id) {
        Entry entry = getEntry(id);

        if (entry != null) {
            return entry.mysqlCollation;
        } else {
            logger.warn("Unexpect mysql charset: " + id);
            return null;
        }
    }
875521
public Entity getEntity(String id) {
        Entity e = getEntities().get(id);
        if (e == null) {
            return null;
        }
        return e;
    }
561934
private String getValueForId(String id) {
        for (int k = 0; k < fieldset.getWidgetCount(); k++) {
            Widget widget = fieldset.getWidget(k);
            if (id.equals(widget.getElement().getAttribute("id")))
                return widget.getElement().getAttribute("value");
        }
        return null;
    }
17327
private void setId(String id) {
        requireArgument(id != null && !id.trim().isEmpty(), "ID cannot be null or empty.");
        _id = id;
    }
95245
public static RAExpression joinOn(RAExpression re1, RAExpression re2,
                                      java.util.function.Function<ImmutableMap<QualifiedAttributeID, Term>, ImmutableList<Function>> getAtomOnExpression,
                                      TermFactory termFactory) throws IllegalJoinException {

        RAExpressionAttributes attributes =
                RAExpressionAttributes.crossJoin(re1.attributes, re2.attributes);

        return new RAExpression(union(re1.dataAtoms, re2.dataAtoms),
                union(re1.filterAtoms, re2.filterAtoms,
                        getAtomOnExpression.apply(attributes.getAttributes())), attributes, termFactory);
    }
488564
public Solution getSolution(String id) {
        for( Solution s : Solution.all() )
            if(s.id.equals(id))
                return s;
        return null;
    }
640506
public static ModifiableDBIDs union(DBIDs ids1, DBIDs ids2) {
    ModifiableDBIDs result = DBIDUtil.newHashSet(Math.max(ids1.size(), ids2.size()));
    result.addDBIDs(ids1);
    result.addDBIDs(ids2);
    return result;
  }
705100
public static Expression join(final Expression e1, final Expression e2) {
        return new RepeatDelimiter(EQ, e1, e2);
    }