Buggy code:
DestinationMapperTest . LOG . info ( "{}" , f ) ; count += 1 ; } else if ( Objects . equals ( remoteEp . getMacAddress ( ) , f . getMatch ( ) . getEthernetMatch ( ) . getEthernetDestination ( ) . getAddress ( ) ) ) { int icount = 0 ; for ( Instruction ins : f . getInstructions ( ) . getInstruction ( ) ) { if ( ( ins . getInstruction ( ) ) instanceof ApplyActionsCase ) { long p = OfTable . getOfPortNum ( tunnelId ) ; List < Action > actions = ( ( ApplyActionsCase ) ( ins . getInstruction ( ) ) ) . getApplyActions ( ) . getAction ( ) ; assertEquals ( nxLoadRegAction ( NxmNxReg7 . class , BigInteger . valueOf ( p ) ) , actions . get ( 4 ) . getAction ( ) ) ; icount += 1 ; } else if ( ( ins . getInstruction ( ) ) instanceof GoToTableCase ) { assertEquals ( gotoTableIns ( ( ( short ) ( ( table . getTableId ( ) ) + 1 ) ) ) , ins . getInstruction ( ) ) ; icount += 1 ; } } assertEquals ( 2 , icount ) ; DestinationMapperTest . LOG . info ( "{}" , f ) ; count += 1 ; } else if ( Objects . equals ( ROUTER_MAC , f . getMatch ( ) . getEthernetMatch ( ) . getEthernetDestination ( ) . getAddress ( ) ) ) { if ( ( f . getMatch ( ) . getLayer3Match ( ) ) instanceof Ipv4Match ) { Instruction ins = f . getInstructions ( ) . getInstruction ( ) . get ( 0 ) ; assertTrue ( ( ( ins . getInstruction ( ) ) instanceof ApplyActionsCase ) ) ; List < Action > actions = ( ( ApplyActionsCase ) ( ins . getInstruction ( ) ) ) . getApplyActions ( ) . getAction ( ) ; long p = OfTable . getOfPortNum ( nodeConnectorId ) ; assertEquals ( nxLoadRegAction ( NxmNxReg7 . class , BigInteger . valueOf ( p ) ) , actions . get ( 2 ) . getAction ( ) ) ; assertEquals ( Integer . valueOf ( 2 ) , actions . get ( 2 ) . getOrder ( ) ) ; assertEquals ( setDlSrcAction ( ROUTER_MAC ) , actions . get ( 3 ) . getAction ( ) ) ; assertEquals ( Integer . valueOf ( 3 ) , actions . get ( 3 ) . getOrder ( ) ) ; assertEquals ( setDlDstAction ( localEp . getMacAddress ( ) ) , actions . get ( 4 ) . getAction ( ) ) ; assertEquals ( Integer . valueOf ( 4 ) , actions . get ( 4 ) . getOrder ( ) ) ; assertEquals ( decNwTtlAction ( ) , actions . get ( 5 ) . getAction ( ) ) ; assertEquals ( Integer . valueOf ( 5 ) , actions . get ( 5 ) . getOrder ( ) ) ; count += 1 ; } else if ( ( f . getMatch ( ) . getLayer3Match ( ) ) instanceof Ipv6Match ) { Instruction ins = f . getInstructions ( ) . getInstruction ( ) . get ( 0 ) ; assertTrue ( ( ( ins . getInstruction ( ) ) instanceof ApplyActionsCase ) ) ; List < Action > actions = ( ( ApplyActionsCase ) ( ins . getInstruction ( ) ) ) . getApplyActions ( ) . getAction ( ) ; long p = OfTable . getOfPortNum ( tunnelId ) ; assertEquals ( nxLoadRegAction ( NxmNxReg7 . class , BigInteger . valueOf ( p ) ) , actions . get ( 4 ) . getAction ( ) ) ; assertEquals ( Integer . valueOf ( 4 ) , actions . get ( 4 ) . getOrder ( ) ) ; assertEquals ( setDlSrcAction ( ROUTER_MAC ) , actions . get ( 5 ) . getAction ( ) ) ; assertEquals ( Integer . valueOf ( 5 ) , actions . get ( 5 ) . getOrder ( ) ) ; assertEquals ( decNwTtlAction ( ) , actions . get ( 6 ) . getAction ( ) ) ; assertEquals ( Integer . valueOf ( 6 ) , actions . get ( 6 ) . getOrder ( ) ) ; count += 1 ; } } else if ( Objects . equals ( MULTICAST_MAC , f . getMatch ( ) . getEthernetMatch ( ) . getEthernetDestination ( ) . getAddress ( ) ) ) { Instruction ins = f . getInstructions ( ) . getInstruction ( ) . get ( 0 ) ; ins = f . getInstructions ( ) . getInstruction ( ) . get ( 0 ) ; assertTrue ( ( ( ins . getInstruction ( ) ) instanceof ApplyActionsCase ) ) ; List < Action > actions = ( ( ApplyActionsCase ) ( ins . getInstruction ( ) ) ) . getApplyActions ( ) . getAction ( ) ; assertEquals ( nxMoveRegTunIdAction ( NxmNxReg0 . class , false ) , actions . get ( 0 ) . getAction ( ) ) ; assertEquals ( Integer . valueOf ( 0 ) , actions . get ( 0 ) . getOrder ( ) ) ; Long v = Long . valueOf ( policyManager . getContextOrdinal ( tid , fd ) ) ; assertEquals ( groupAction ( v ) , actions . get ( 1 ) . getAction ( ) ) ; assertEquals ( Integer . valueOf ( 1 ) , actions . get ( 1 ) . getOrder ( ) ) ; count += 1 ; } } <START_BUG> assertEquals ( 5 , count ) ; <END_BUG> t = dosync ( flowMap ) ; verify ( t , never ( ) ) . put ( any ( LogicalDatastoreType . class ) , Matchers . < InstanceIdentifier < Flow > > any ( ) , any ( Flow . class ) , anyBoolean ( ) ) ; } @ Override protected EndpointBuilder localEP ( ) { } @ Override protected EndpointBuilder remoteEP ( NodeId remoteNodeId ) { } private void addSwitches ( ) { }

Fix:
assertEquals ( 8 , count ) ;