private static String javaLangObjectToString(Object value) {
    String hash = Integer.toHexString(System.identityHashCode(value));
    Class<?> type = value.getClass();
    String typeName = type.getCanonicalName();
    return (typeName == null ? type.getName() : typeName) + "@" + hash;
  }
Returns a string representation of a value, or <tt>null</tt> if
the value should not be shown (because it does not add any valuable
information). Note that the method may also change rendered values
of child expression.

@param expr the expression whose value is to be rendered
@return a string representation of the value
spock-core/src/main/java/org/spockframework/runtime/ExpressionInfoValueRenderer.java