/** addAll(this) throws IAE */ public void testAddAllSelf() { try { Succeed q = new Succeed(); q.addAll(q); shouldThrow(); } catch (IllegalArgumentException success) { } }
/** addAll(null) throws NPE */ public void testAddAll1() { try { Succeed q = new Succeed(); q.addAll(null); shouldThrow(); } catch (NullPointerException success) { } }
/** addAll of a collection with null elements throws NPE */ public void testAddAll2() { try { Succeed q = new Succeed(); Integer[] ints = new Integer[SIZE]; q.addAll(Arrays.asList(ints)); shouldThrow(); } catch (NullPointerException success) { } }
/** * addAll of a collection with any null elements throws NPE after possibly adding some elements */ public void testAddAll3() { try { Succeed q = new Succeed(); Integer[] ints = new Integer[SIZE]; for (int i = 0; i < SIZE - 1; ++i) ints[i] = new Integer(i); q.addAll(Arrays.asList(ints)); shouldThrow(); } catch (NullPointerException success) { } }