--- jsr166/src/test/tck/Collection8Test.java 2018/03/26 21:06:51 1.49 +++ jsr166/src/test/tck/Collection8Test.java 2018/04/04 03:35:13 1.50 @@ -906,6 +906,26 @@ public class Collection8Test extends JSR } } + public void testObjectMethods() { + ThreadLocalRandom rnd = ThreadLocalRandom.current(); + Collection c = impl.emptyCollection(); + for (int n = rnd.nextInt(3); n--> 0; ) + c.add(impl.makeElement(rnd.nextInt())); + assertEquals(c, c); + if (c instanceof List) { + List copy = new ArrayList(c); + assertEquals(copy, c); + assertEquals(c, copy); + assertEquals(copy.hashCode(), c.hashCode()); + } + if (c instanceof Set) { + Set copy = new HashSet(c); + assertEquals(copy, c); + assertEquals(c, copy); + assertEquals(copy.hashCode(), c.hashCode()); + } + } + // public void testCollection8DebugFail() { // fail(impl.klazz().getSimpleName()); // }