Java 8: use lambdas and function references
[yangtools.git] / yang / yang-parser-impl / src / test / java / org / opendaylight / yangtools / yang / parser / repo / SharedSchemaRepositoryTest.java
index 2a2fd60f11e88cbfd3eeb18914c5bc0990f3568d..f9dff888633ea5be2aefeda2488fc485ede15044 100644 (file)
@@ -242,12 +242,8 @@ public class SharedSchemaRepositoryTest {
 
         assertEquals(4, listener.registeredSources.size());
 
-        final Function<PotentialSchemaSource<?>, SourceIdentifier> potSourceToSID = new Function<PotentialSchemaSource<?>, SourceIdentifier>() {
-            @Override
-            public SourceIdentifier apply(final PotentialSchemaSource<?> input) {
-                return input.getSourceIdentifier();
-            }
-        };
+        final Function<PotentialSchemaSource<?>, SourceIdentifier> potSourceToSID =
+                PotentialSchemaSource::getSourceIdentifier;
         assertThat(Collections2.transform(listener.registeredSources, potSourceToSID),
                 both(hasItem(RevisionSourceIdentifier.create("test", Optional.absent())))
                         .and(hasItem(RevisionSourceIdentifier.create("test", Optional.of("2012-12-12"))))