@Test
    void verifyEncodeDecodeNonRegisteredClass() {
        val tgt = new MockTicketGrantingTicket(USERNAME);
        val expectedST = new MockServiceTicket(ST_ID, RegisteredServiceTestUtils.getService(), tgt);

        val step = new UnregisteredServiceTicketExpirationPolicy(1, 600);
        expectedST.setExpirationPolicy(step);
        try {
            transcoder.encode(expectedST);
            throw new AssertionError("Unregistered class is not allowed by Kryo");
        } catch (final KryoException e) {
            LOGGER.trace(e.getMessage(), e);
        } catch (final Exception e) {
            throw new AssertionError("Not resetting Kryo between de-serializations with unregistered class.");
        }
    }
Unit test for {@link CasKryoTranscoder} class.

@author Marvin S. Addison
@since 3.0.0
support/cas-server-support-memcached-core/src/test/java/org/apereo/cas/memcached/kryo/CasKryoTranscoderTests.java