public static String toStringOrDump(@Nullable Object value) {
    if (isHandledByInspectOrToString(value)) {
      return GroovyRuntimeUtil.toString(value);
    }
    if (value instanceof Wrapper) {
      Wrapper wrapper = (Wrapper) value;
      return String.format("%s as %s", toStringOrDump(wrapper.unwrap()), wrapper.getType().getSimpleName());
    }
    if (value.getClass().isArray()) {
      return dumpArrayString((Object[]) value, RenderUtil::toStringOrDump);
    }
    return DefaultGroovyMethods.dump(value);
  }
Returns true if the Object is handled properly by {@link org.codehaus.groovy.runtime.InvokerHelper#inspect(java.lang.Object)}
or {@link org.codehaus.groovy.runtime.InvokerHelper#toString(Object)}, either by special handling or if the Class has
an own {@code toString()} implementation.
spock-core/src/main/java/org/spockframework/util/RenderUtil.java