Simplify lambdas.
This commit is contained in:
parent
348cf47741
commit
5d05df0f9e
|
@ -110,12 +110,10 @@ public class LockingVisitorsTest {
|
||||||
public void testResultValidation() {
|
public void testResultValidation() {
|
||||||
final Object hidden = new Object();
|
final Object hidden = new Object();
|
||||||
final StampedLockVisitor<Object> lock = LockingVisitors.stampedLockVisitor(hidden);
|
final StampedLockVisitor<Object> lock = LockingVisitors.stampedLockVisitor(hidden);
|
||||||
final Object o1 = lock.applyReadLocked(h -> {
|
final Object o1 = lock.applyReadLocked(h -> new Object());
|
||||||
return new Object(); });
|
|
||||||
assertNotNull(o1);
|
assertNotNull(o1);
|
||||||
assertNotSame(hidden, o1);
|
assertNotSame(hidden, o1);
|
||||||
final Object o2 = lock.applyWriteLocked(h -> {
|
final Object o2 = lock.applyWriteLocked(h -> new Object());
|
||||||
return new Object(); });
|
|
||||||
assertNotNull(o2);
|
assertNotNull(o2);
|
||||||
assertNotSame(hidden, o2);
|
assertNotSame(hidden, o2);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue