### Question:
OvsdbPortUpdateCommand extends AbstractTransactionCommand { @VisibleForTesting void updateVlanTrunks(final Port port, final OvsdbTerminationPointAugmentationBuilder ovsdbTerminationPointBuilder) { Set<Long> portTrunks = port.getTrunksColumn().getData(); List<Trunks> modelTrunks = new ArrayList<>(); if (!portTrunks.isEmpty()) { for (Long trunk: portTrunks) { if (trunk != null) { modelTrunks.add(new TrunksBuilder() .setTrunk(new VlanId(Uint16.valueOf(trunk.intValue()))).build()); } } } ovsdbTerminationPointBuilder.setTrunks(modelTrunks); } OvsdbPortUpdateCommand(InstanceIdentifierCodec instanceIdentifierCodec, OvsdbConnectionInstance key,
            TableUpdates updates, DatabaseSchema dbSchema); @Override void execute(ReadWriteTransaction transaction);  }### Answer:
@SuppressWarnings("unchecked") @Test public void testUpdateVlanTrunks() throws Exception { Port port = mock(Port.class); Column<GenericTableSchema, Set<Long>> column = mock(Column.class); when(port.getTrunksColumn()).thenReturn(column); Set<Long> portTrunks = new HashSet<>(); portTrunks.add((long) 300); when(column.getData()).thenReturn(portTrunks); TrunksBuilder trunksBuilder = mock(TrunksBuilder.class); PowerMockito.whenNew(TrunksBuilder.class).withNoArguments().thenReturn(trunksBuilder); PowerMockito.whenNew(VlanId.class).withAnyArguments().thenReturn(mock(VlanId.class)); when(trunksBuilder.setTrunk(any(VlanId.class))).thenReturn(trunksBuilder); OvsdbTerminationPointAugmentationBuilder ovsdbTerminationPointBuilder = mock( OvsdbTerminationPointAugmentationBuilder.class); when(ovsdbTerminationPointBuilder.setTrunks(any(List.class))).thenReturn(ovsdbTerminationPointBuilder); Whitebox.invokeMethod(ovsdbPortUpdateCommand, "updateVlanTrunks", port, ovsdbTerminationPointBuilder); verify(trunksBuilder).setTrunk(any(VlanId.class)); verify(ovsdbTerminationPointBuilder).setTrunks(any(List.class)); }