### Question:
OvsdbPortUpdateCommand extends AbstractTransactionCommand { @Override public void execute(ReadWriteTransaction transaction) { final InstanceIdentifier<Node> connectionIId = getOvsdbConnectionInstance().getInstanceIdentifier(); if (portUpdatedRows == null && interfaceOldRows == null || interfaceOldRows.isEmpty() && portUpdatedRows.isEmpty()) { return; } Optional<Node> node = readNode(transaction, connectionIId); if (node.isPresent()) { updateTerminationPoints(transaction, node.get()); } } OvsdbPortUpdateCommand(InstanceIdentifierCodec instanceIdentifierCodec, OvsdbConnectionInstance key,
            TableUpdates updates, DatabaseSchema dbSchema); @Override void execute(ReadWriteTransaction transaction);  }### Answer:
@SuppressWarnings("unchecked") @Test public void testExecute() throws Exception { portUpdatedRows = new HashMap<>(); interfaceOldRows = new HashMap<>(); portUpdatedRows.put(mock(UUID.class), mock(Port.class)); interfaceOldRows.put(mock(UUID.class), mock(Interface.class)); field(OvsdbPortUpdateCommand.class, "portUpdatedRows").set(ovsdbPortUpdateCommand, portUpdatedRows); field(OvsdbPortUpdateCommand.class, "interfaceOldRows").set(ovsdbPortUpdateCommand, interfaceOldRows); OvsdbConnectionInstance ovsdbConnectionInstance = mock(OvsdbConnectionInstance.class); when(ovsdbPortUpdateCommand.getOvsdbConnectionInstance()).thenReturn(ovsdbConnectionInstance); InstanceIdentifier<Node> connectionIId = mock(InstanceIdentifier.class); when(ovsdbConnectionInstance.getInstanceIdentifier()).thenReturn(connectionIId); Optional<Node> node = Optional.of(mock(Node.class)); PowerMockito.doReturn(node).when(ovsdbPortUpdateCommand, "readNode", any(ReadWriteTransaction.class), any(InstanceIdentifier.class)); doNothing().when(ovsdbPortUpdateCommand).updateTerminationPoints(any(ReadWriteTransaction.class), any(Node.class)); ReadWriteTransaction transaction = mock(ReadWriteTransaction.class); PowerMockito.mockStatic(SouthboundUtil.class); PowerMockito.when(SouthboundUtil.readNode(any(ReadWriteTransaction.class), any(InstanceIdentifier.class))) .thenReturn(node); ovsdbPortUpdateCommand.execute(transaction); verify(ovsdbConnectionInstance).getInstanceIdentifier(); verify(ovsdbPortUpdateCommand).updateTerminationPoints(any(ReadWriteTransaction.class), any(Node.class)); }