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 |
|
// } |