--- jsr166/src/test/tck/PriorityQueueTest.java 2003/09/25 11:02:41 1.6 +++ jsr166/src/test/tck/PriorityQueueTest.java 2003/12/27 19:26:43 1.8 @@ -1,8 +1,9 @@ /* - * Written by members of JCP JSR-166 Expert Group and released to the - * public domain. Use, modify, and redistribute this code in any way - * without acknowledgement. Other contributors include Andrew Wright, - * Jeffrey Hayes, Pat Fischer, Mike Judd. + * Written by Doug Lea with assistance from members of JCP JSR-166 + * Expert Group and released to the public domain, as explained at + * http://creativecommons.org/licenses/publicdomain + * Other contributors include Andrew Wright, Jeffrey Hayes, + * Pat Fisher, Mike Judd. */ import junit.framework.*; @@ -171,6 +172,17 @@ public class PriorityQueueTest extends J shouldThrow(); } catch (NullPointerException success) { } } + + /** + * add(null) throws NPE + */ + public void testAddNull() { + try { + PriorityQueue q = new PriorityQueue(1); + q.add(null); + shouldThrow(); + } catch (NullPointerException success) { } + } /** * Offer of comparable element succeeds