Code Clean Up
[bgpcep.git] / rsvp / spi / src / test / java / org / opendaylight / protocol / rsvp / parser / spi / subobjects / EROSubobjectListParserTest.java
index cf5d21babcfb1d987700f80e21da6c02be17e38b..d00575f309059e0ec8a93497ce4c17036cc84ad3 100644 (file)
@@ -39,22 +39,16 @@ public class EROSubobjectListParserTest {
 
     @Before
     public void setUp() throws RSVPParsingException {
-        Mockito.doAnswer(new Answer<Object>() {
-            @Override
-            public Object answer(final InvocationOnMock invocation) throws Throwable {
-                if (((ByteBuf) invocation.getArguments()[1]).readableBytes() == 0) {
-                    return null;
-                }
-                return EROSubobjectListParserTest.this.subObj;
+        Mockito.doAnswer(invocation -> {
+            if (((ByteBuf) invocation.getArguments()[1]).readableBytes() == 0) {
+                return null;
             }
+            return EROSubobjectListParserTest.this.subObj;
         }).when(this.registry).parseSubobject(Mockito.anyInt(), Mockito.any(ByteBuf.class), Mockito.anyBoolean());
         Mockito.doReturn("lala").when(this.subObj).toString();
-        Mockito.doAnswer(new Answer<Object>() {
-            @Override
-            public Object answer(final InvocationOnMock invocation) throws Throwable {
-                ((ByteBuf) invocation.getArguments()[1]).writeByte(1);
-                return null;
-            }
+        Mockito.doAnswer(invocation -> {
+            ((ByteBuf) invocation.getArguments()[1]).writeByte(1);
+            return null;
         }).when(this.registry).serializeSubobject(Mockito.any(SubobjectContainer.class), Mockito.any(ByteBuf.class));
     }