### Question:
OvsdbPortUpdateCommand extends AbstractTransactionCommand { @VisibleForTesting void updateVlanMode(final Port port, final OvsdbTerminationPointAugmentationBuilder ovsdbTerminationPointBuilder) { Collection<String> vlanMode = port.getVlanModeColumn().getData(); if (!vlanMode.isEmpty()) { Iterator<String> itr = vlanMode.iterator(); String vlanType = itr.next(); if (vlanType.equals(SouthboundConstants.VlanModes.ACCESS.getMode())) { ovsdbTerminationPointBuilder .setVlanMode(OvsdbPortInterfaceAttributes.VlanMode.Access); } else if (vlanType.equals(SouthboundConstants.VlanModes.NATIVE_TAGGED.getMode())) { ovsdbTerminationPointBuilder .setVlanMode(OvsdbPortInterfaceAttributes.VlanMode.NativeTagged); } else if (vlanType.equals(SouthboundConstants.VlanModes.NATIVE_UNTAGGED.getMode())) { ovsdbTerminationPointBuilder .setVlanMode(OvsdbPortInterfaceAttributes.VlanMode.NativeUntagged); } else if (vlanType.equals(SouthboundConstants.VlanModes.TRUNK.getMode())) { ovsdbTerminationPointBuilder .setVlanMode(OvsdbPortInterfaceAttributes.VlanMode.Trunk); } else { LOG.debug("Invalid vlan mode {}.", vlanType); } } } OvsdbPortUpdateCommand(InstanceIdentifierCodec instanceIdentifierCodec, OvsdbConnectionInstance key,
            TableUpdates updates, DatabaseSchema dbSchema); @Override void execute(ReadWriteTransaction transaction);  }### Answer:
@SuppressWarnings("unchecked") @Test public void testUpdateVlanMode() throws Exception { Port port = mock(Port.class); Column<GenericTableSchema, Set<String>> column = mock(Column.class); when(port.getVlanModeColumn()).thenReturn(column); Set<String> set = new HashSet<>(); set.add(VLAN_MODE_ACCESS); when(column.getData()).thenReturn(set); OvsdbTerminationPointAugmentationBuilder ovsdbTerminationPointBuilder = mock( OvsdbTerminationPointAugmentationBuilder.class); when(ovsdbTerminationPointBuilder.setVlanMode(OvsdbPortInterfaceAttributes.VlanMode.Access)) .thenReturn(ovsdbTerminationPointBuilder); Whitebox.invokeMethod(ovsdbPortUpdateCommand, "updateVlanMode", port, ovsdbTerminationPointBuilder); verify(ovsdbTerminationPointBuilder).setVlanMode(any(VlanMode.class)); }