--- old/test-ng/tests/org/openjdk/tests/java/util/functions/IntUnaryOperatorTest.java 2012-07-31 19:45:14.612289991 -0400 +++ new/test-ng/tests/org/openjdk/tests/java/util/functions/IntUnaryOperatorTest.java 2012-07-31 19:45:14.436289995 -0400 @@ -57,9 +57,14 @@ assertEquals( operand.intValue(), 7 ); } - public void tryItWithLambdaExpression() { + public void testUpdateOps() { AtomicInteger atomInt = new AtomicInteger(3); - assertEquals( atomInt.compareAndSet(x -> x + 1), 4 ); + // make sure we the updated value is returned + assertEquals( atomInt.updateAndGet(x -> x + 1), 4 ); + // then the previous value is returned + assertEquals( atomInt.getAndUpdate(x -> x + 1), 4 ); + // finally, verify that the update was successful + assertEquals( atomInt.get(), 5 ); }; public class IncByTwo implements IntUnaryOperator {