if (kryo != null && kryo.javaClass.simpleName == "Kryo") {
val setReferencesMethod = kryo.javaClass.getMethod("setReferences", Boolean::class.javaPrimitiveType)
setReferencesMethod.invoke(kryo, true)
logger.info("Successfully called kryo.setReferences(true) on pool instance via $methodName")