public static byte[] serialize(final Serializable object) {
        return FunctionUtils.doUnchecked(() -> {
            try (val outBytes = new ByteArrayOutputStream()) {
                serialize(object, outBytes);
                return outBytes.toByteArray();
            }
        });
    }
Serialize an object.

@param object The object to be serialized
@return the +byte[]+ containing the object
@since 5.0.0
core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/serialization/SerializationUtils.java