public static <T_IN, T_OUT> Selection<T_OUT> convert(final Selection<T_IN> in,
                                                         final Function<T_IN, T_OUT> converter) {
        if (in == null) {
            return null;
        }

        final Selection<T_OUT> out = Selection.selectNone();
        out.matchAll = in.matchAll;
        if (in.set != null) {
            out.set = in.set.stream().map(converter).collect(Collectors.toSet());
        }

        return out;
    }
Utility class to match on sets of id's with concepts like match anything and specific id's.
stroom-util-shared/src/main/java/stroom/util/shared/Selection.java