### Question:
OvsdbPortUpdateCommand extends AbstractTransactionCommand { @VisibleForTesting void updateInterfaceExternalIds(final Interface interf, final OvsdbTerminationPointAugmentationBuilder ovsdbTerminationPointBuilder) { Map<String, String> interfaceExternalIds = interf.getExternalIdsColumn().getData(); if (interfaceExternalIds != null && !interfaceExternalIds.isEmpty()) { List<InterfaceExternalIds> externalIdsList = new ArrayList<>(); for (Entry<String, String> entry : interfaceExternalIds.entrySet()) { String externalIdKey = entry.getKey(); String externalIdValue = entry.getValue(); if (externalIdKey != null && externalIdValue != null) { externalIdsList.add(new InterfaceExternalIdsBuilder() .setExternalIdKey(externalIdKey) .setExternalIdValue(externalIdValue).build()); } } ovsdbTerminationPointBuilder.setInterfaceExternalIds(externalIdsList); } } OvsdbPortUpdateCommand(InstanceIdentifierCodec instanceIdentifierCodec, OvsdbConnectionInstance key,
            TableUpdates updates, DatabaseSchema dbSchema); @Override void execute(ReadWriteTransaction transaction);  }### Answer:
@SuppressWarnings("unchecked") @Test public void testUpdateInterfaceExternalIds() throws Exception { Interface interf = mock(Interface.class); Column<GenericTableSchema, Map<String, String>> column = mock(Column.class); when(interf.getExternalIdsColumn()).thenReturn(column); Map<String, String> map = new HashMap<>(); when(column.getData()).thenReturn(map); map.put(EXTERNAL_ID_KEY, EXTERNAL_ID_VALUE); when(column.getData()).thenReturn(map); InterfaceExternalIdsBuilder interfaceExternalIdsBuilder = mock(InterfaceExternalIdsBuilder.class); PowerMockito.whenNew(InterfaceExternalIdsBuilder.class).withNoArguments() .thenReturn(interfaceExternalIdsBuilder); when(interfaceExternalIdsBuilder.setExternalIdKey(anyString())).thenReturn(interfaceExternalIdsBuilder); when(interfaceExternalIdsBuilder.setExternalIdValue(anyString())).thenReturn(interfaceExternalIdsBuilder); when(interfaceExternalIdsBuilder.build()).thenReturn(mock(InterfaceExternalIds.class)); OvsdbTerminationPointAugmentationBuilder ovsdbTerminationPointBldr = mock( OvsdbTerminationPointAugmentationBuilder.class); when(ovsdbTerminationPointBldr.setInterfaceExternalIds(any(List.class))).thenReturn(ovsdbTerminationPointBldr); Whitebox.invokeMethod(ovsdbPortUpdateCommand, "updateInterfaceExternalIds", interf, ovsdbTerminationPointBldr); verify(interfaceExternalIdsBuilder).setExternalIdKey(anyString()); verify(interfaceExternalIdsBuilder).setExternalIdValue(anyString()); }