### Question:
LoopbackCommand extends AbstractInterfaceCommand { public static LoopbackCommandBuilder builder() { return new LoopbackCommandBuilder(); } private  LoopbackCommand(LoopbackCommandBuilder builder); static LoopbackCommandBuilder builder(); boolean getBvi(); @Override InterfaceBuilder getInterfaceBuilder(); @Override String toString();  }### Answer:
@Test public void testAddLoopback_WithBridgeDomain() throws ExecutionException, InterruptedException { ReadWriteTransaction rwTx = dataBroker.newReadWriteTransaction(); LoopbackCommand addCommand = LoopbackCommand.builder() .setOperation(General.Operations.PUT) .setInterfaceName(INTERFACE_NAME) .setDescription(DESCRIPTION) .setBvi(true) .setPhysAddress(MAC_ADDRESS) .setIpPrefix(IP_PREFIX) .setIpAddress(IP_ADDRESS) .setBridgeDomain(BRIDGE_DOMAIN) .setEnabled(true) .build(); Assert.assertEquals(BRIDGE_DOMAIN, addCommand.getBridgeDomain()); Optional<Interface> optional = executeCommand(rwTx, addCommand); Assert.assertTrue(optional.isPresent()); Assert.assertEquals(BASIC_INTERFACE_WITH_BD, optional.get()); }
@Test public void testDeleteLoopbackPort() throws ExecutionException, InterruptedException { ReadWriteTransaction rwTx = dataBroker.newReadWriteTransaction(); rwTx.put(LogicalDatastoreType.CONFIGURATION, VppIidFactory.getInterfaceIID(BASIC_INTERFACE.getKey()), BASIC_INTERFACE, true); rwTx.submit().get(); Optional<Interface> optional = DataStoreHelper.readFromDs(LogicalDatastoreType.CONFIGURATION, VppIidFactory.getInterfaceIID(BASIC_INTERFACE.getKey()), dataBroker.newReadOnlyTransaction()); Assert.assertTrue(optional.isPresent()); LoopbackCommand deleteCommand = LoopbackCommand.builder() .setOperation(General.Operations.DELETE) .setInterfaceName(INTERFACE_NAME) .setIpPrefix(IP_PREFIX) .setIpAddress(IP_ADDRESS) .build(); ReadWriteTransaction rwTxDel = dataBroker.newReadWriteTransaction(); deleteCommand.execute(rwTxDel); rwTxDel.submit(); Optional<Interface> optionalDeleted = DataStoreHelper.readFromDs(LogicalDatastoreType.CONFIGURATION, VppIidFactory.getInterfaceIID(new InterfaceKey(deleteCommand.getName())), dataBroker.newReadOnlyTransaction()); Assert.assertFalse(optionalDeleted.isPresent()); }