public static void configureKryo(Kryo kryo) {
        // Since kryo 5.0.0-RC3 the default is to not use references.
        // With Yauaa you will go into a StackOverflow if you do not support references in Kryo because of
        // circulair references in the data structures.
        // See https://github.com/EsotericSoftware/kryo/issues/617
        //     https://github.com/EsotericSoftware/kryo/issues/789
        kryo.setReferences(true);

        // Let Kryo output a lot of debug information
//        Log.DEBUG();
//        kryo.setRegistrationRequired(true);
//        kryo.setWarnUnregisteredClasses(true);

        // Register the Java classes we need
        kryo.register(Collections.emptySet().getClass());
        kryo.register(Collections.emptyList().getClass());
        kryo.register(Collections.emptyMap().getClass());

        kryo.register(ArrayList.class);

        kryo.register(LinkedHashSet.class);
        kryo.register(LinkedHashMap.class);
        kryo.register(HashSet.class);
        kryo.register(HashMap.class);
        kryo.register(TreeSet.class);
        kryo.register(TreeMap.class);
        kryo.register(LinkedCaseInsensitiveMap.class);

        // This class
        kryo.register(AbstractUserAgentAnalyzerDirect.class);

        ClientHintsAnalyzer.configureKryo(kryo);

        // The config classes
        kryo.register(MatcherConfig.class);
        kryo.register(MatcherConfig.ConfigLine.class);
        kryo.register(MatcherConfig.ConfigLine.Type.class);
        kryo.register(AnalyzerConfig.class);
        kryo.register(MatcherConfig.class);
        kryo.register(TestCase.class);

        // All classes we have under this.
        kryo.register(Analyzer.class);
        kryo.register(UserAgent.ImmutableUserAgent.class);
        kryo.register(AgentField.ImmutableAgentField.class);
        kryo.register(UserAgent.MutableUserAgent.class);
        kryo.register(AgentField.MutableAgentField.class);

        kryo.register(MatchMaker.class);
        kryo.register(UserAgentStringMatchMaker.class);

        kryo.register(Matcher.class);
        kryo.register(Matcher.MatcherDemotedExtractAction.class);
        kryo.register(MatcherAction.class);
        kryo.register(MatcherList.class);
        kryo.register(MatchesList.class);
        kryo.register(MatcherExtractAction.class);
        kryo.register(MatcherVariableAction.class);
        kryo.register(MatcherRequireAction.class);
        kryo.register(MatcherFailIfFoundAction.class);
        kryo.register(WordRangeVisitor.Range.class);

        kryo.register(CalculateAgentEmail.class);
        kryo.register(CalculateAgentName.class);
        kryo.register(CalculateAgentClass.class);
        kryo.register(CalculateDeviceBrand.class);
        kryo.register(CalculateDeviceName.class);
        kryo.register(CalculateNetworkType.class);
        kryo.register(ConcatNONDuplicatedCalculator.class);
        kryo.register(FieldCalculator.class);
        kryo.register(MajorVersionCalculator.class);
        kryo.register(MacOSXMajorVersionCalculator.class);
        kryo.register(VersionCleanupCalculator.class);

        kryo.register(UserAgentTreeFlattener.class);
        kryo.register(TreeExpressionEvaluator.class);
        kryo.register(WalkList.class);
        kryo.register(StepContains.class);
        kryo.register(StepNotContains.class);
        kryo.register(StepDefaultIfNull.class);
        kryo.register(StepEndsWith.class);
        kryo.register(StepEquals.class);
        kryo.register(StepIsInSet.class);
        kryo.register(StepIsNotInSet.class);
        kryo.register(StepIsNull.class);
        kryo.register(StepNotEquals.class);
        kryo.register(StepStartsWith.class);
        kryo.register(StepIsInLookupContains.class);
        kryo.register(StepIsNotInLookupContains.class);
        kryo.register(StepIsInLookupPrefix.class);
        kryo.register(StepIsNotInLookupPrefix.class);
        kryo.register(StepLookup.class);
        kryo.register(StepLookupContains.class);
        kryo.register(StepLookupPrefix.class);
        kryo.register(StepBackToFull.class);
        kryo.register(StepCleanVersion.class);
        kryo.register(StepIsValidVersion.class);
        kryo.register(StepConcat.class);
        kryo.register(StepConcatPostfix.class);
        kryo.register(StepConcatPrefix.class);
        kryo.register(StepNormalizeBrand.class);
        kryo.register(StepExtractBrandFromUrl.class);
        kryo.register(StepReplaceString.class);
        kryo.register(StepSegmentRange.class);
        kryo.register(StepWordRange.class);
        kryo.register(StepDown.class);
        kryo.register(StepNext.class);
        kryo.register(StepNextN.class);
        kryo.register(StepPrev.class);
        kryo.register(StepPrevN.class);
        kryo.register(StepUp.class);

        StringPrefixMap.configureKryo(kryo);
    }
This is used to configure the provided Kryo instance if Kryo serialization is desired.
@param kryo The instance of com.esotericsoftware.kryo.Kryo that needs to be configured.
analyzer/src/main/java/nl/basjes/parse/useragent/utils/KryoConfig.java