### Question:
DeleteTopicSubCommand implements SubCommand { @Override public void execute(CommandLine commandLine, Options options, RPCHook rpcHook) throws SubCommandException { DefaultMQAdminExt adminExt = new DefaultMQAdminExt(rpcHook); adminExt.setInstanceName(Long.toString(System.currentTimeMillis())); try { String topic = commandLine.getOptionValue('t').trim(); adminExt.start(); if (commandLine.hasOption('c')) { String clusterName = commandLine.getOptionValue('c').trim(); deleteTopic(adminExt, clusterName, topic); return; } else if (commandLine.hasOption("b")) { String brokerAddrs = commandLine.getOptionValue('b').trim(); String[] brokerArr = brokerAddrs.split(";"); if (brokerArr.length <= 0) { throw new IllegalArgumentException("not broker"); } Set<String> brokerSet = new HashSet<>(); Collections.addAll(brokerSet, brokerArr); deleteTopicByBroker(adminExt, brokerSet, topic); return; } ServerUtil.printCommandLineHelp("mqadmin " + this.commandName(), options); } catch (Exception e) { throw new SubCommandException(this.getClass().getSimpleName() + " command failed", e); } finally { adminExt.shutdown(); } }  static void deleteTopic(final DefaultMQAdminExt adminExt,
        final String clusterName,
        final String topic
    ); static void deleteTopicByBroker(final DefaultMQAdminExt adminExt,
        final Set<String> brokerAddrs,
        final String topic
    ); @Override String commandName(); @Override String commandDesc(); @Override Options buildCommandlineOptions(Options options); @Override void execute(CommandLine commandLine, Options options, RPCHook rpcHook);  }### Answer:
@Test public void testExecute() { DeleteTopicSubCommand cmd = new DeleteTopicSubCommand(); Options options = ServerUtil.buildCommandlineOptions(new Options()); String[] subargs = new String[] {"-t unit-test", "-c default-cluster"}; final CommandLine commandLine = ServerUtil.parseCmdLine("mqadmin " + cmd.commandName(), subargs, cmd.buildCommandlineOptions(options), new PosixParser()); assertThat(commandLine.getOptionValue('t').trim()).isEqualTo("unit-test"); assertThat(commandLine.getOptionValue("c").trim()).isEqualTo("default-cluster"); }