@Override
    public CloseableKryo getObject() {
        val kryo = new CloseableKryo(this.kryoPool);
        kryo.setInstantiatorStrategy(new DefaultInstantiatorStrategy(new StdInstantiatorStrategy()));
        kryo.setWarnUnregisteredClasses(this.warnUnregisteredClasses);
        kryo.setAutoReset(this.autoReset);
        kryo.setReferences(this.replaceObjectsByReferences);
        kryo.setRegistrationRequired(this.registrationRequired);

        LOGGER.debug("Constructing a kryo instance with the following settings:");
        LOGGER.debug("warnUnregisteredClasses: [{}]", this.warnUnregisteredClasses);
        LOGGER.debug("autoReset: [{}]", this.autoReset);
        LOGGER.debug("replaceObjectsByReferences: [{}]", this.replaceObjectsByReferences);
        LOGGER.debug("registrationRequired: [{}]", this.registrationRequired);

        registerNativeJdkComponentsWithKryo(kryo);
        registerImmutableOrEmptyCollectionsWithKryo(kryo);

        val classes = new ArrayList<>(classesToRegister);
        classes.sort(Comparator.comparing(Class::getName));
        classes.forEach(c -> {
            LOGGER.trace("Registering serializable class [{}] with Kryo", c.getName());
            kryo.register(c);
        });
        return kryo;
    }
This is {@link CloseableKryoFactory}.

@author Misagh Moayyed
@since 5.2.0
support/cas-server-support-memcached-core/src/main/java/org/apereo/cas/memcached/kryo/CloseableKryoFactory.java