Created AbstractSetWriter to remove duplicated code from Intersect, Union and UnionAll