### Question:
OvsdbManagersUpdateCommand extends AbstractTransactionCommand { private void updateManagers(ReadWriteTransaction transaction, Map<UUID, Manager> newUpdatedManagerRows, Map<UUID, OpenVSwitch> newUpdatedOpenVSwitchRows) { for (Map.Entry<UUID, OpenVSwitch> ovsdbNodeEntry : newUpdatedOpenVSwitchRows.entrySet()) { final List<ManagerEntry> managerEntries = SouthboundMapper.createManagerEntries(ovsdbNodeEntry.getValue(), newUpdatedManagerRows); LOG.debug("Update Ovsdb Node : {} with manager entries : {}", ovsdbNodeEntry.getValue(), managerEntries); for (ManagerEntry managerEntry : managerEntries) { transaction.merge(LogicalDatastoreType.OPERATIONAL, getManagerEntryIid(managerEntry), managerEntry); } } } OvsdbManagersUpdateCommand(OvsdbConnectionInstance key,
            TableUpdates updates, DatabaseSchema dbSchema); @Override void execute(ReadWriteTransaction transaction);  }### Answer:
@SuppressWarnings("unchecked") @Test public void testUpdateManagers() throws Exception { Map<UUID, OpenVSwitch> updatedOpenVSwitchRows = new HashMap<>(); OpenVSwitch openVSwitch = mock(OpenVSwitch.class); updatedOpenVSwitchRows.put(mock(UUID.class), openVSwitch); PowerMockito.mockStatic(SouthboundMapper.class); List<ManagerEntry> managerEntries = new ArrayList<>(); managerEntries.add(mock(ManagerEntry.class)); when(SouthboundMapper.createManagerEntries(any(OpenVSwitch.class), any(Map.class))).thenReturn(managerEntries); ReadWriteTransaction transaction = mock(ReadWriteTransaction.class); Map<UUID, Manager> updatedManagerRows = new HashMap<>(); PowerMockito.doReturn(mock(InstanceIdentifier.class)).when(ovsdbManagersUpdateCommand, "getManagerEntryIid", any(ManagerEntry.class)); doNothing().when(transaction).merge(any(LogicalDatastoreType.class), any(InstanceIdentifier.class), any(ManagerEntry.class)); Whitebox.invokeMethod(ovsdbManagersUpdateCommand, "updateManagers", transaction, updatedManagerRows, updatedOpenVSwitchRows); verify(transaction).merge(any(LogicalDatastoreType.class), any(InstanceIdentifier.class), any(ManagerEntry.class)); }