### Question:
OvsdbPortUpdateCommand extends AbstractTransactionCommand { @VisibleForTesting void updateOfPort(final Interface interf, final OvsdbTerminationPointAugmentationBuilder ovsdbTerminationPointBuilder) { Set<Long> ofPorts = interf.getOpenFlowPortColumn().getData(); if (ofPorts != null && !ofPorts.isEmpty()) { Iterator<Long> ofPortsIter = ofPorts.iterator(); long ofPort = ofPortsIter.next(); if (ofPort >= 0) { ovsdbTerminationPointBuilder.setOfport(Uint32.valueOf(ofPort)); } else { LOG.debug("Received negative value for ofPort from ovsdb for {} {}", interf.getName(),ofPort); } } } OvsdbPortUpdateCommand(InstanceIdentifierCodec instanceIdentifierCodec, OvsdbConnectionInstance key,
            TableUpdates updates, DatabaseSchema dbSchema); @Override void execute(ReadWriteTransaction transaction);  }### Answer:
@SuppressWarnings("unchecked") @Test public void testUpdateOfPort() throws Exception { Interface interf = mock(Interface.class); Set<Long> ofPorts = new HashSet<>(); ofPorts.add((long) 10000); Column<GenericTableSchema, Set<Long>> column = mock(Column.class); when(interf.getOpenFlowPortColumn()).thenReturn(column); when(column.getData()).thenReturn(ofPorts); OvsdbTerminationPointAugmentationBuilder ovsdbTerminationPointBuilder = mock( OvsdbTerminationPointAugmentationBuilder.class); when(ovsdbTerminationPointBuilder.setOfport(any(Uint32.class))).thenReturn(ovsdbTerminationPointBuilder); when(interf.getName()).thenReturn(INTERFACE_NAME); Whitebox.invokeMethod(ovsdbPortUpdateCommand, "updateOfPort", interf, ovsdbTerminationPointBuilder); verify(ovsdbTerminationPointBuilder).setOfport(any(Uint32.class)); }