Author: desruisseaux
Date: Mon Mar 16 22:31:22 2015
New Revision: 1667146

URL: http://svn.apache.org/r1667146
Log:
Diamond operator and lambda expression.

Modified:
    
sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/util/collection/CacheTest.java

Modified: 
sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/util/collection/CacheTest.java
URL: 
http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/util/collection/CacheTest.java?rev=1667146&r1=1667145&r2=1667146&view=diff
==============================================================================
--- 
sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/util/collection/CacheTest.java
 [UTF-8] (original)
+++ 
sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/util/collection/CacheTest.java
 [UTF-8] Mon Mar 16 22:31:22 2015
@@ -19,7 +19,6 @@ package org.apache.sis.util.collection;
 import java.util.Map;
 import java.util.HashMap;
 import java.util.AbstractMap.SimpleEntry;
-import java.util.concurrent.Callable;
 import java.util.concurrent.atomic.AtomicReference;
 import java.io.IOException;
 import java.io.PrintWriter;
@@ -58,8 +57,7 @@ public final strictfp class CacheTest ex
      */
     @Test
     public void testStrongReferences() {
-        WeakValueHashMapTest.testStrongReferences(
-                new Cache<Integer,Integer>(WeakValueHashMapTest.SAMPLE_SIZE, 
0, false));
+        WeakValueHashMapTest.testStrongReferences(new 
Cache<>(WeakValueHashMapTest.SAMPLE_SIZE, 0, false));
     }
 
     /**
@@ -73,8 +71,7 @@ public final strictfp class CacheTest ex
     @Test
     @DependsOnMethod("testStrongReferences")
     public void testWeakReferences() throws InterruptedException {
-        WeakValueHashMapTest.testWeakReferences(
-                new Cache<Integer,Integer>(WeakValueHashMapTest.SAMPLE_SIZE, 
0, false));
+        WeakValueHashMapTest.testWeakReferences(new 
Cache<>(WeakValueHashMapTest.SAMPLE_SIZE, 0, false));
     }
 
     /**
@@ -236,11 +233,7 @@ public final strictfp class CacheTest ex
                     final Integer expected = new Integer(i * i); // We really 
want new instance.
                     final Integer value;
                     try {
-                        value = cache.getOrCreate(key, new Callable<Integer>() 
{
-                            @Override public Integer call() {
-                                return expected;
-                            }
-                        });
+                        value = cache.getOrCreate(key, () -> expected);
                         assertEquals(expected, value);
                     } catch (Throwable e) {
                         if (!failures.compareAndSet(null, e)) {


Reply via email to