--- jsr166/src/test/tck/Collection8Test.java 2018/06/22 00:04:58 1.57 +++ jsr166/src/test/tck/Collection8Test.java 2019/02/22 19:27:47 1.58 @@ -210,41 +210,17 @@ public class Collection8Test extends JSR BlockingQueue q = (BlockingQueue) c; assertThrows( NullPointerException.class, - () -> { - try { q.offer(null, 1L, HOURS); } - catch (InterruptedException ex) { - throw new AssertionError(ex); - }}, - () -> { - try { q.put(null); } - catch (InterruptedException ex) { - throw new AssertionError(ex); - }}); + () -> q.offer(null, 1L, HOURS), + () -> q.put(null)); } if (c instanceof BlockingDeque) { BlockingDeque q = (BlockingDeque) c; assertThrows( NullPointerException.class, - () -> { - try { q.offerFirst(null, 1L, HOURS); } - catch (InterruptedException ex) { - throw new AssertionError(ex); - }}, - () -> { - try { q.offerLast(null, 1L, HOURS); } - catch (InterruptedException ex) { - throw new AssertionError(ex); - }}, - () -> { - try { q.putFirst(null); } - catch (InterruptedException ex) { - throw new AssertionError(ex); - }}, - () -> { - try { q.putLast(null); } - catch (InterruptedException ex) { - throw new AssertionError(ex); - }}); + () -> q.offerFirst(null, 1L, HOURS), + () -> q.offerLast(null, 1L, HOURS), + () -> q.putFirst(null), + () -> q.putLast(null)); } }