private static void registerNativeJdkComponentsWithKryo(final Kryo kryo) {
        kryo.register(GeneralSecurityException.class, new ThrowableSerializer());
        kryo.register(AccountNotFoundException.class, new ThrowableSerializer());

        kryo.register(Class.class, new DefaultSerializers.ClassSerializer());
        kryo.register(ArrayList.class);
        kryo.register(LinkedList.class);
        kryo.register(HashMap.class);
        kryo.register(LinkedHashMap.class);
        kryo.register(ConcurrentHashMap.class);
        kryo.register(LinkedHashSet.class);
        kryo.register(ConcurrentSkipListSet.class);
        kryo.register(ConcurrentSkipListMap.class, new DefaultSerializers.ConcurrentSkipListMapSerializer());
        kryo.register(TreeMap.class, new DefaultSerializers.TreeMapSerializer());
        kryo.register(TreeSet.class, new DefaultSerializers.TreeSetSerializer());
        kryo.register(HashSet.class);
        kryo.register(EnumMap.class, new EnumMapSerializer());
        kryo.register(EnumSet.class, new EnumSetSerializer());

        kryo.register(Object[].class);
        kryo.register(String[].class);
        kryo.register(Long[].class);
        kryo.register(Integer[].class);
        kryo.register(Double[].class);
        kryo.register(double[].class);
        kryo.register(float[].class);
        kryo.register(long[].class);
        kryo.register(char[].class);
        kryo.register(int[].class);
        kryo.register(short[].class);
        kryo.register(byte[].class);
        kryo.register(ByteBuffer.class);

        kryo.register(URL.class, new URLSerializer());
        kryo.register(URI.class, new URISerializer());
        kryo.register(Pattern.class, new RegexSerializer());
        kryo.register(UUID.class, new UUIDSerializer());

        kryo.register(Date.class, new DateSerializer(Date.class));
        kryo.register(Calendar.class, new GregorianCalendarSerializer());
        kryo.register(GregorianCalendar.class, new GregorianCalendarSerializer());

        kryo.register(Duration.class, new TimeSerializers.DurationSerializer());
        kryo.register(Period.class, new TimeSerializers.PeriodSerializer());
        kryo.register(LocalDate.class, new TimeSerializers.LocalDateSerializer());
        kryo.register(ZonedDateTime.class, new TimeSerializers.ZonedDateTimeSerializer());
        kryo.register(LocalDateTime.class, new TimeSerializers.LocalDateTimeSerializer());

        kryo.register(org.joda.time.LocalDate.class, new JodaLocalDateSerializer());
        kryo.register(DateTime.class, new JodaDateTimeSerializer());
        kryo.register(org.joda.time.LocalDateTime.class, new JodaLocalDateTimeSerializer());
        
        kryo.register(ZoneOffset.class, new TimeSerializers.ZoneOffsetSerializer());
        kryo.register(ZoneId.class, new TimeSerializers.ZoneIdSerializer());
        
        kryo.register(Clock.systemUTC().getClass());
        kryo.register(EnumSet.class, new EnumSetSerializer());
    }
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