ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/tck/Collection8Test.java
(Generate patch)

Comparing jsr166/src/test/tck/Collection8Test.java (file contents):
Revision 1.49 by jsr166, Mon Mar 26 21:06:51 2018 UTC vs.
Revision 1.50 by jsr166, Wed Apr 4 03:35:13 2018 UTC

# Line 906 | Line 906 | public class Collection8Test extends JSR
906          }
907      }
908  
909 +    public void testObjectMethods() {
910 +        ThreadLocalRandom rnd = ThreadLocalRandom.current();
911 +        Collection c = impl.emptyCollection();
912 +        for (int n = rnd.nextInt(3); n--> 0; )
913 +            c.add(impl.makeElement(rnd.nextInt()));
914 +        assertEquals(c, c);
915 +        if (c instanceof List) {
916 +            List copy = new ArrayList(c);
917 +            assertEquals(copy, c);
918 +            assertEquals(c, copy);
919 +            assertEquals(copy.hashCode(), c.hashCode());
920 +        }
921 +        if (c instanceof Set) {
922 +            Set copy = new HashSet(c);
923 +            assertEquals(copy, c);
924 +            assertEquals(c, copy);
925 +            assertEquals(copy.hashCode(), c.hashCode());
926 +        }
927 +    }
928 +
929   //     public void testCollection8DebugFail() {
930   //         fail(impl.klazz().getSimpleName());
931   //     }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines