package me.nallar.javatransformer.internal.util;

import lombok.experimental.UtilityClass;

import java.util.*;
import java.util.stream.*;

@UtilityClass
public class CollectionUtil {
	@SafeVarargs
	@SuppressWarnings("varargs")
	public static <T> Stream<T> union(Collection<T>... collections) {
		return union(Arrays.asList(collections));
	}

	public static <T> Stream<T> union(Collection<Collection<T>> collections) {
		return collections.stream().flatMap(Collection::stream);
	}
}

@@ -454,26 +454,52 @@
 Map(
-Collection::
+x -%3E x == null ? Stream.empty() : x.
 stream
+()
 );%0A%09

Handle null collections as empty in union(Collection)