public static <T> Set<T> asUnmodifiabledConsistentOrderSet(final List<T> items) {
        if (NullSafe.isEmptyCollection(items)) {
            return Collections.emptySet();
        } else {
            // Use a LinkedHashSet to ensure iteration order is consistent
            final LinkedHashSet<T> cleanedSet = NullSafe.stream(items)
                    .sorted() // Sort the items for consistent insert order
                    .filter(Objects::nonNull)
                    .collect(Collectors.toCollection(LinkedHashSet::new));
            return Collections.unmodifiableSet(cleanedSet);
        }
    }
Return a {@link Set} containing items, with iteration order matching
the order in items array. Useful in config classes where a HashSet would
result in an undefined order on serialisation.
stroom-util/src/main/java/stroom/util/collections/CollectionUtil.java