@Override
    public String fromList(final Collection<T> object) {
        return FunctionUtils.doUnchecked(() -> {
            try (val writer = new StringWriter()) {
                getObjectMapper().writerFor(object.getClass()).with(prettyPrinter).writeValue(writer, object);
                return writer.toString();
            }
        });
    }
Generic class to serialize objects to/from JSON based on jackson.

@author Misagh Moayyed
@param <T> the type parameter
@since 4.1
core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/serialization/BaseJacksonSerializer.java