Make sure we are not dependent on SingletonSet hierarchy in
serialization writeout path.
Change-Id: I7b602f166bccc418ea27af0b887f5868fadbf9e3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
0fc692ac97b7a899750bc4eb6559dacdabdc0433)
return obj == this || obj instanceof Set<?> other && other.size() == 1 && otherContains(other);
}
+ @Serial
+ final Object writeReplace() {
+ return new SSv1(getElement());
+ }
+
@SuppressFBWarnings(value = "DCN_NULLPOINTER_EXCEPTION",
justification = "https://github.com/spotbugs/spotbugs/issues/1954")
private boolean otherContains(final @NonNull Collection<?> other) {