@Override
    public boolean equals(final Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof Selection)) {
            return false;
        }
        final Selection<?> that = (Selection<?>) o;
        return matchAll == that.matchAll &&
                Objects.equals(set, that.set);
    }
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