--- jsr166/src/test/tck/JSR166TestCase.java 2017/07/22 18:23:59 1.235 +++ jsr166/src/test/tck/JSR166TestCase.java 2017/08/16 17:18:34 1.236 @@ -1913,6 +1913,18 @@ public class JSR166TestCase extends Test Collections.shuffle(Arrays.asList(array), ThreadLocalRandom.current()); } + /** + * Returns the same String as would be returned by {@link + * Object#toString}, whether or not the given object's class + * overrides toString(). + * + * @see System#identityHashCode + */ + static String identityString(Object x) { + return x.getClass().getName() + + "@" + Integer.toHexString(System.identityHashCode(x)); + } + // --- Shared assertions for Executor tests --- /**