public static <T> Set<T> symmetricDifference(Collection<? extends T> c1, Collection<? extends T> c2) {
        Set<T> diff1 = new HashSet<>(c1);
        diff1.removeAll(c2);

        Set<T> diff2 = new HashSet<>(c2);
        diff2.removeAll(c1);

        diff1.addAll(diff2);
        return diff1;
    }
Returns the symmetric difference between two collections, i.e. the set of elements
that occur in exactly one of the collections.
vespajlib/src/main/java/com/yahoo/collections/CollectionUtil.java