### Question:
DeleteFunctionCmd implements Command { @Override public boolean applyTo(DomainObject obj) { Program program = (Program) obj; Listing listing = program.getListing(); Function func = listing.getFunctionAt(entry); if (func == null) { if (ignoreMissingFunction) { return true; } return false; } if (!entry.isExternalAddress()) { func.promoteLocalUserLabelsToGlobal(); } listing.removeFunction(entry); return true; } DeleteFunctionCmd(Address entry);  DeleteFunctionCmd(Address entry, boolean ignoreMissingFunction); @Override String getName(); @Override boolean applyTo(DomainObject obj); @Override String getStatusMsg();  }### Answer:
@Test public void testDeleteFunction() { Address address = addr(0x0); String defaultName = SymbolUtilities.getDefaultFunctionName(address); int transactionID = program.startTransaction("TEST"); Function function = createFunction(defaultName, address, new AddressSet(address, address.add(200L))); assertNotNull("The test function was not created as expected.", function); DeleteFunctionCmd deleteFunctionCmd = new DeleteFunctionCmd(address); deleteFunctionCmd.applyTo(program); function = program.getListing().getFunctionAt(address); assertNull("The function was not deleted as expected.", function); Symbol[] symbols = program.getSymbolTable().getSymbols(address); assertTrue( "The symbol where the function was removed has the " + "default name of the function when it should not.", !containsMatchingSymbolName(symbols, defaultName)); String customName = "CustomFunctionName"; function = createFunction(customName, address, new AddressSet(address, address.add(200L))); assertNotNull("The test function was not created as expected.", function); deleteFunctionCmd = new DeleteFunctionCmd(address); deleteFunctionCmd.applyTo(program); function = program.getListing().getFunctionAt(address); assertNull("The function was not deleted as expected.", function); symbols = program.getSymbolTable().getSymbols(address); assertTrue( "A label with the same name as the function was not " + "created when that function was deleted.", containsMatchingSymbolName(symbols, customName)); program.endTransaction(transactionID, false); }