@Override
    public String[] resolveFrom(final JoinPoint auditableTarget, final Object retval) {
        if (retval instanceof final Collection collection) {
            val size = collection.size();
            val returnValues = new String[size];
            var i = 0;
            for (var iter = collection.iterator(); iter.hasNext() && i < size; i++) {
                val o = iter.next();
                if (o != null) {
                    returnValues[i] = toResourceString(o);
                }
            }

            return returnValues;
        }

        if (retval instanceof final Object[] vals) {
            return Arrays.stream(vals).map(this::toResourceString).toArray(String[]::new);
        }

        return new String[]{toResourceString(retval)};
    }
Implementation of {@link AuditResourceResolver} that uses the toString version of the return value
as the resource.

@author Scott Battaglia
@since 1.0
core/cas-server-core-audit-api/src/main/java/org/apereo/inspektr/audit/spi/support/ReturnValueAsStringResourceResolver.java