--- jsr166/src/test/tck/LinkedListTest.java 2015/05/24 01:42:14 1.40 +++ jsr166/src/test/tck/LinkedListTest.java 2016/10/17 00:56:11 1.42 @@ -21,12 +21,20 @@ public class LinkedListTest extends JSR1 } public static Test suite() { - return new TestSuite(LinkedListTest.class); + class Implementation implements CollectionImplementation { + public Class klazz() { return LinkedList.class; } + public Collection emptyCollection() { return new LinkedList(); } + public Object makeElement(int i) { return i; } + public boolean isConcurrent() { return false; } + public boolean permitsNulls() { return true; } + } + return newTestSuite(LinkedListTest.class, + CollectionTest.testSuite(new Implementation())); } /** * Returns a new queue of given size containing consecutive - * Integers 0 ... n. + * Integers 0 ... n - 1. */ private LinkedList populatedQueue(int n) { LinkedList q = new LinkedList(); @@ -35,6 +43,8 @@ public class LinkedListTest extends JSR1 assertTrue(q.offer(new Integer(i))); assertFalse(q.isEmpty()); assertEquals(n, q.size()); + assertEquals((Integer) 0, q.peekFirst()); + assertEquals((Integer) (n - 1), q.peekLast()); return q; }