### Question:
VhostUserCommand extends AbstractInterfaceCommand { public static VhostUserCommandBuilder builder() { return new VhostUserCommandBuilder(); } private  VhostUserCommand(VhostUserCommandBuilder builder); static VhostUserCommandBuilder builder(); String getSocket(); VhostUserRole getRole(); @Override InterfaceBuilder getInterfaceBuilder(); @Override String toString();  }### Answer:
@Test public void AddVhostTest() { ReadWriteTransaction transaction = dataBroker.newReadWriteTransaction(); VhostUserCommand addCommand = VhostUserCommand.builder() .setOperation(General.Operations.PUT) .setName(INTERFACE_NAME) .setDescription(DESCRIPTION) .setRole(VhostUserRole.Server) .setSocket(SOCKET_NAME) .setBridgeDomain(BRIDGE_DOMAIN) .setEnabled(true) .build(); addCommand.execute(transaction); transaction.submit(); ReadOnlyTransaction readOnlyTransaction = dataBroker.newReadOnlyTransaction(); Optional<Interface> optional = DataStoreHelper.readFromDs(LogicalDatastoreType.CONFIGURATION, VppIidFactory.getInterfaceIID(new InterfaceKey(INTERFACE_NAME)), readOnlyTransaction); Assert.assertTrue("Interface was not written to DS", optional.isPresent()); Interface anInterface = optional.get(); Assert.assertEquals(BASIC_INTERFACE, anInterface); }
@Test public void DeleteVhostTest() { ReadWriteTransaction transaction = dataBroker.newReadWriteTransaction(); transaction.put(LogicalDatastoreType.CONFIGURATION, VppIidFactory.getInterfaceIID(BASIC_INTERFACE.getKey()), BASIC_INTERFACE, true); transaction.submit(); Optional<Interface> optional = DataStoreHelper.readFromDs(LogicalDatastoreType.CONFIGURATION, VppIidFactory.getInterfaceIID(BASIC_INTERFACE.getKey()), dataBroker.newReadOnlyTransaction()); Assert.assertTrue("Interface was not written to DS", optional.isPresent()); VhostUserCommand deleteCommand = VhostUserCommand.builder() .setOperation(General.Operations.DELETE) .setName(INTERFACE_NAME) .setSocket(SOCKET_NAME) .build(); ReadWriteTransaction deleteTransaction = dataBroker.newReadWriteTransaction(); deleteCommand.execute(deleteTransaction); deleteTransaction.submit(); Optional<Interface> optionalDeleted = DataStoreHelper.readFromDs(LogicalDatastoreType.CONFIGURATION, VppIidFactory.getInterfaceIID(new InterfaceKey(deleteCommand.getName())), dataBroker.newReadOnlyTransaction()); Assert.assertFalse("Interface was not deleted from DS", optionalDeleted.isPresent()); }