Clean up instance checks and casts
[openflowplugin.git] / openflowplugin-impl / src / test / java / org / opendaylight / openflowplugin / impl / protocol / deserialization / action / SetNwTtlActionDeserializerTest.java
index 95138ea1383f2830e0a08c439794182ae4045aa0..ec8546b4f66830138d58d9c1d21ad3b876801766 100644 (file)
@@ -11,14 +11,13 @@ package org.opendaylight.openflowplugin.impl.protocol.deserialization.action;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 
+import io.netty.buffer.ByteBuf;
+import io.netty.buffer.UnpooledByteBufAllocator;
 import org.junit.Test;
 import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwTtlActionCase;
 
-import io.netty.buffer.ByteBuf;
-import io.netty.buffer.UnpooledByteBufAllocator;
-
 public class SetNwTtlActionDeserializerTest extends AbstractActionDeserializerTest {
 
     @Test
@@ -30,8 +29,8 @@ public class SetNwTtlActionDeserializerTest extends AbstractActionDeserializerTe
         in.writeZero(ActionConstants.SET_NW_TTL_PADDING);
 
         final Action action = deserializeAction(in);
-        assertTrue(SetNwTtlActionCase.class.isInstance(action));
-        assertEquals(nwTtl, SetNwTtlActionCase.class.cast(action).getSetNwTtlAction().getNwTtl().shortValue());
+        assertTrue(action instanceof SetNwTtlActionCase);
+        assertEquals(nwTtl, ((SetNwTtlActionCase) action).getSetNwTtlAction().getNwTtl().shortValue());
         assertEquals(0, in.readableBytes());
     }