### Question:
WipeWritePermSubCommand implements SubCommand { @Override public void execute(CommandLine commandLine, Options options, RPCHook rpcHook) { DefaultMQAdminExt defaultMQAdminExt = new DefaultMQAdminExt(rpcHook); defaultMQAdminExt.setInstanceName(Long.toString(System.currentTimeMillis())); try { defaultMQAdminExt.start(); String brokerName = commandLine.getOptionValue('b').trim(); List<String> namesrvList = defaultMQAdminExt.getNameServerAddressList(); if (namesrvList != null) { for (String namesrvAddr : namesrvList) { try { int wipeTopicCount = defaultMQAdminExt.wipeWritePermOfBroker(namesrvAddr, brokerName); System.out.printf("wipe write perm of broker[%s] in name server[%s] OK, %d%n", brokerName, namesrvAddr, wipeTopicCount ); } catch (Exception e) { System.out.printf("wipe write perm of broker[%s] in name server[%s] Failed%n", brokerName, namesrvAddr ); e.printStackTrace(); } } } } catch (Exception e) { e.printStackTrace(); } finally { defaultMQAdminExt.shutdown(); } }  @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() { WipeWritePermSubCommand cmd = new WipeWritePermSubCommand(); Options options = ServerUtil.buildCommandlineOptions(new Options()); String[] subargs = new String[] {"-b default-broker"}; final CommandLine commandLine = ServerUtil.parseCmdLine("mqadmin " + cmd.commandName(), subargs, cmd.buildCommandlineOptions(options), new PosixParser()); cmd.execute(commandLine, options, null); }