@Test
public void testFloodPacket() throws Exception {

    List<NodeConnectorRef> nodeConnectors = new ArrayList<>();
    InstanceIdentifier<NodeConnector> ncInsId1 = InstanceIdentifier.builder(Nodes.class).child(Node.class)
            .child(NodeConnector.class, new NodeConnectorKey(new NodeConnectorId("1"))).build();
    InstanceIdentifier<NodeConnector> ncInsId2 = InstanceIdentifier.builder(Nodes.class).child(Node.class)
            .child(NodeConnector.class, new NodeConnectorKey(new NodeConnectorId("2"))).build();
    nodeConnectors.add(new NodeConnectorRef(ncInsId1));
    nodeConnectors.add(new NodeConnectorRef(ncInsId1));
    nodeConnectors.add(new NodeConnectorRef(ncInsId2));
    HashMap<String, List<NodeConnectorRef>> switchNodeConnectors = Mockito.mock(HashMap.class);
    when(switchNodeConnectors.get(any(String.class))).thenReturn(nodeConnectors);
    when(inventoryReader.getSwitchNodeConnectors()).thenReturn(switchNodeConnectors);
    packetDispatcher.floodPacket("", null, new NodeConnectorRef(ncInsId2),
            new NodeConnectorRef(InstanceIdentifier.create(NodeConnector.class)));
    verify(inventoryReader, times(0)).setRefreshData(true);
    verify(inventoryReader, times(0)).readInventory();
    verify(packetProcessingService, times(2)).transmitPacket(any(TransmitPacketInput.class));
}