@Override
    public void write(final Kryo kryo, final Output output, final Set<Object> object) {
        output.writeInt(object.size(), true);
        for (val elm : object) {
            kryo.writeClassAndObject(output, elm);
        }
    }
This is {@link ImmutableNativeJavaSetSerializer}.

@author Misagh Moayyed
@since 6.1.0
support/cas-server-support-memcached-core/src/main/java/org/apereo/cas/memcached/kryo/serial/ImmutableNativeJavaSetSerializer.java