### Question:
OvsdbPortUpdateCommand extends AbstractTransactionCommand { @VisibleForTesting void updatePortOtherConfig(final Port port, final OvsdbTerminationPointAugmentationBuilder ovsdbTerminationPointBuilder) { Map<String, String> portOtherConfigMap = port.getOtherConfigColumn().getData(); if (portOtherConfigMap != null && !portOtherConfigMap.isEmpty()) { List<PortOtherConfigs> portOtherConfigs = new ArrayList<>(); for (Entry<String, String> entry : portOtherConfigMap.entrySet()) { String portOtherConfigKeyString = entry.getKey(); String portOtherConfigValueString = entry.getValue(); if (portOtherConfigKeyString != null && portOtherConfigValueString != null) { portOtherConfigs.add(new PortOtherConfigsBuilder() .setOtherConfigKey(portOtherConfigKeyString) .setOtherConfigValue(portOtherConfigValueString).build()); } } ovsdbTerminationPointBuilder.setPortOtherConfigs(portOtherConfigs); } } OvsdbPortUpdateCommand(InstanceIdentifierCodec instanceIdentifierCodec, OvsdbConnectionInstance key,
            TableUpdates updates, DatabaseSchema dbSchema); @Override void execute(ReadWriteTransaction transaction);  }### Answer:
@SuppressWarnings("unchecked") @Test public void testUpdatePortOtherConfig() throws Exception { Port port = mock(Port.class); Column<GenericTableSchema, Map<String, String>> column = mock(Column.class); when(port.getOtherConfigColumn()).thenReturn(column); Map<String, String> map = new HashMap<>(); map.put(OTHER_CONFIG_KEY, OTHER_CONFIG_VALUE); when(column.getData()).thenReturn(map); PortOtherConfigsBuilder portOtherConfigsBuilder = mock(PortOtherConfigsBuilder.class); PowerMockito.whenNew(PortOtherConfigsBuilder.class).withNoArguments().thenReturn(portOtherConfigsBuilder); when(portOtherConfigsBuilder.setOtherConfigKey(anyString())).thenReturn(portOtherConfigsBuilder); when(portOtherConfigsBuilder.setOtherConfigValue(anyString())).thenReturn(portOtherConfigsBuilder); when(portOtherConfigsBuilder.build()).thenReturn(mock(PortOtherConfigs.class)); OvsdbTerminationPointAugmentationBuilder ovsdbTerminationPointBuilder = mock( OvsdbTerminationPointAugmentationBuilder.class); when(ovsdbTerminationPointBuilder.setInterfaceOtherConfigs(any(List.class))) .thenReturn(ovsdbTerminationPointBuilder); Whitebox.invokeMethod(ovsdbPortUpdateCommand, "updatePortOtherConfig", port, ovsdbTerminationPointBuilder); verify(portOtherConfigsBuilder).setOtherConfigKey(anyString()); verify(portOtherConfigsBuilder).setOtherConfigValue(anyString()); }