Bug 8055: use lambdas instead of anonymous classes
[ovsdb.git] / southbound / southbound-impl / src / test / java / org / opendaylight / ovsdb / southbound / InstanceIdentifierCodecTest.java
index cbc0a5e9c9cbb259737a739181989a1183ad381d..c9765266b7654e75dfa06b91ff7a7ad133434f89 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Inocybe Technologies and others.  All rights reserved.
+ * Copyright © 2015, 2017 Inocybe Technologies and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
@@ -24,7 +24,6 @@ import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.mockito.Mock;
 import org.mockito.Mockito;
-import org.mockito.invocation.InvocationOnMock;
 import org.mockito.stubbing.Answer;
 import org.opendaylight.controller.sal.core.api.model.SchemaService;
 import org.opendaylight.mdsal.binding.dom.codec.api.BindingNormalizedNodeSerializer;
@@ -118,12 +117,8 @@ public class InstanceIdentifierCodecTest {
                 .thenReturn(yiid);
 
         mock(InstanceIdentifier.class);
-        when(bindingNormalizedNodeSerializer.fromYangInstanceIdentifier(yiid))
-                .thenAnswer(new Answer<InstanceIdentifier<?>>() {
-                    public InstanceIdentifier<?> answer(InvocationOnMock invocation) throws Exception {
-                        return (InstanceIdentifier<?>) invocation.getArguments()[0];
-                    }
-                });
+        when(bindingNormalizedNodeSerializer.fromYangInstanceIdentifier(yiid)).thenAnswer(
+                (Answer<InstanceIdentifier<?>>) invocation -> (InstanceIdentifier<?>) invocation.getArguments()[0]);
 
         assertEquals("Error, did not return correct InstanceIdentifier<?> object", any(InstanceIdentifier.class),
                 instanceIdCodec.bindingDeserializer(""));