--- jsr166/src/test/jtreg/util/PriorityQueue/ForgetMeNot.java 2010/09/27 19:15:15 1.3 +++ jsr166/src/test/jtreg/util/PriorityQueue/ForgetMeNot.java 2015/09/15 07:17:15 1.4 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -37,16 +37,14 @@ public class ForgetMeNot { private static void noMoreElements(final Iterator it) { for (int j = 0; j < 2; j++) { - THROWS(NoSuchElementException.class, - new Fun() { void f() { it.next(); }}); + THROWS(NoSuchElementException.class, () -> it.next()); check(! it.hasNext()); } } private static void removeIsCurrentlyIllegal(final Iterator it) { for (int j = 0; j < 2; j++) { - THROWS(IllegalStateException.class, - new Fun() { void f() { it.remove(); }}); + THROWS(IllegalStateException.class, () -> it.remove()); } } @@ -146,7 +144,7 @@ public class ForgetMeNot { try {realMain(args);} catch (Throwable t) {unexpected(t);} System.out.printf("%nPassed = %d, failed = %d%n%n", passed, failed); if (failed > 0) throw new AssertionError("Some tests failed");} - private abstract static class Fun {abstract void f() throws Throwable;} + interface Fun {void f() throws Throwable;} static void THROWS(Class k, Fun... fs) { for (Fun f : fs) try { f.f(); fail("Expected " + k.getName() + " not thrown"); }