@Override
public EquatableValueSet intersect(ValueSet other)
{
EquatableValueSet otherValueSet = checkCompatibility(other);
if (whiteList && otherValueSet.isWhiteList()) {
return new EquatableValueSet(type, true, intersect(entries, otherValueSet.entries));
}
else if (whiteList) {
return new EquatableValueSet(type, true, subtract(entries, otherValueSet.entries));
}
else if (otherValueSet.isWhiteList()) {
return new EquatableValueSet(type, true, subtract(otherValueSet.entries, entries));
}
else {
return new EquatableValueSet(type, false, union(otherValueSet.entries, entries));
}
}