### Question:
TerminationPointCreateCommand implements TransactCommand { public static void stampInstanceIdentifier(final TransactionBuilder transaction, final InstanceIdentifier<OvsdbTerminationPointAugmentation> iid, final String interfaceName, final InstanceIdentifierCodec instanceIdentifierCodec) { Port port = transaction.getTypedRowWrapper(Port.class); port.setName(interfaceName); port.setExternalIds(Collections.emptyMap()); Mutate mutate = TransactUtils.stampInstanceIdentifierMutation(transaction, iid, port.getSchema(), port.getExternalIdsColumn().getSchema(), instanceIdentifierCodec); transaction.add(mutate .where(port.getNameColumn().getSchema().opEqual(interfaceName)) .build()); }  @Override void execute(final TransactionBuilder transaction, final BridgeOperationalState state,
            final DataChangeEvent events, final InstanceIdentifierCodec instanceIdentifierCodec); @Override void execute(final TransactionBuilder transaction, final BridgeOperationalState state,
            final Collection<DataTreeModification<Node>> modifications,
            final InstanceIdentifierCodec instanceIdentifierCodec); static void stampInstanceIdentifier(final TransactionBuilder transaction,
            final InstanceIdentifier<OvsdbTerminationPointAugmentation> iid, final String interfaceName,
            final InstanceIdentifierCodec instanceIdentifierCodec);  }### Answer:
@SuppressWarnings("unchecked") @Test public void testStampInstanceIdentifier() { TransactionBuilder transaction = mock(TransactionBuilder.class); Port port = mock(Port.class); when(transaction.getTypedRowWrapper(eq(Port.class))).thenReturn(port); doNothing().when(port).setName(anyString()); doNothing().when(port).setExternalIds(any(HashMap.class)); when(port.getSchema()).thenReturn(mock(GenericTableSchema.class)); Column<GenericTableSchema, Map<String, String>> column = mock(Column.class); when(port.getExternalIdsColumn()).thenReturn(column); when(column.getSchema()).thenReturn(mock(ColumnSchema.class)); Mutate mutate = mock(Mutate.class); PowerMockito.mockStatic(TransactUtils.class); when(TransactUtils.stampInstanceIdentifierMutation(any(TransactionBuilder.class), any(InstanceIdentifier.class), any(GenericTableSchema.class), any(ColumnSchema.class), any(InstanceIdentifierCodec.class))).thenReturn( mutate); Column<GenericTableSchema, String> nameColumn = mock(Column.class); when(port.getNameColumn()).thenReturn(nameColumn); ColumnSchema<GenericTableSchema, String> nameColumnSchema = mock(ColumnSchema.class); when(nameColumn.getSchema()).thenReturn(nameColumnSchema); when(nameColumnSchema.opEqual(anyString())).thenReturn(mock(Condition.class)); Where where = mock(Where.class); when(mutate.where(any(Condition.class))).thenReturn(where); when(where.build()).thenReturn(mock(Operation.class)); when(transaction.add(any(Operation.class))).thenReturn(transaction); String interfaceName = INTERFACE_NAME; InstanceIdentifier<OvsdbTerminationPointAugmentation> iid = mock(InstanceIdentifier.class); TerminationPointCreateCommand.stampInstanceIdentifier(transaction, iid, interfaceName, mock(InstanceIdentifierCodec.class)); verify(port).setName(anyString()); verify(port).getExternalIdsColumn(); verify(transaction).add(any(Operation.class)); }