Source:
public boolean processCommand(IExtensionContext ctx, IConversation conversation, String command, StringTokenizer parameters, String commandLine) { boolean displayInfoAboutTerminals = false; boolean displayInfoAboutBalances = false; boolean displayInfoAboutCash = false; List<String> serialNumbers = new ArrayList<>(); if (!parameters.hasMoreTokens()) { displayInfoAboutBalances = true; displayInfoAboutTerminals = true; }else { String parameter = parameters.nextToken(); if ("balances".equalsIgnoreCase(parameter) || "balance".equalsIgnoreCase(parameter) || "b".equalsIgnoreCase(parameter)) { displayInfoAboutBalances = true; }else if ("terminals".equalsIgnoreCase(parameter) || "terminal".equalsIgnoreCase(parameter) || "t".equalsIgnoreCase(parameter)) { displayInfoAboutTerminals = true; serialNumbers = redSerialNumbers(parameters); }else if ((parameter.startsWith("R") || parameter.startsWith("r") || parameter.startsWith("L") || parameter.startsWith("l")) && parameter.length() == 5+1) { displayTransactionInformation(ctx, conversation, parameter.toUpperCase()); return true; }else if ((parameter.startsWith("I") || parameter.startsWith("i")) && parameter.length() == 15+1) { displayIdentityInformation(ctx, conversation, parameter.toUpperCase(), null); return true; }else if (isPhoneNumber(parameter)) { displayIdentityInformation(ctx, conversation, null, parsePhoneNumber(parameter)); return true; } else if ("Cash".equalsIgnoreCase(parameter) || "cash".equalsIgnoreCase(parameter) || "c".equalsIgnoreCase(parameter)) { displayInfoAboutCash = true; serialNumbers = redSerialNumbers(parameters); } } if (displayInfoAboutTerminals || displayInfoAboutBalances || displayInfoAboutCash) { if (displayInfoAboutTerminals) { displayTerminalsInformation(ctx, conversation, serialNumbers); } if (displayInfoAboutBalances) { displayBalanceInformation(ctx, conversation); } if (displayInfoAboutCash) { displayTerminalCashInformation(ctx, conversation, serialNumbers); } return true; }else { conversation.sendText("Invalid parameters. See help for more information."); } return true; }

Target:
public boolean processCommand(IExtensionContext ctx, IConversation conversation, String command, StringTokenizer parameters, String commandLine) { boolean displayInfoAboutTerminals = false; boolean displayInfoAboutBalances = false; boolean displayInfoAboutCash = false; List<String> serialNumbers = new ArrayList<>(); if (!parameters.hasMoreTokens()) { displayInfoAboutBalances = true; displayInfoAboutTerminals = true; }else { String parameter = parameters.nextToken(); if ("balances".equalsIgnoreCase(parameter) || "balance".equalsIgnoreCase(parameter) || "b".equalsIgnoreCase(parameter)) { displayInfoAboutBalances = true; }else if ("terminals".equalsIgnoreCase(parameter) || "terminal".equalsIgnoreCase(parameter) || "t".equalsIgnoreCase(parameter)) { displayInfoAboutTerminals = true; serialNumbers = readSerialNumbers(parameters); }else if ((parameter.startsWith("R") || parameter.startsWith("r") || parameter.startsWith("L") || parameter.startsWith("l")) && parameter.length() == 5+1) { displayTransactionInformation(ctx, conversation, parameter.toUpperCase()); return true; }else if ((parameter.startsWith("I") || parameter.startsWith("i")) && parameter.length() == 15+1) { displayIdentityInformation(ctx, conversation, parameter.toUpperCase(), null); return true; }else if (isPhoneNumber(parameter)) { displayIdentityInformation(ctx, conversation, null, parsePhoneNumber(parameter)); return true; } else if ("cash".equalsIgnoreCase(parameter) || "c".equalsIgnoreCase(parameter)) { displayInfoAboutCash = true; serialNumbers = readSerialNumbers(parameters); } } if (displayInfoAboutTerminals || displayInfoAboutBalances || displayInfoAboutCash) { if (displayInfoAboutTerminals) { displayTerminalsInformation(ctx, conversation, serialNumbers); } if (displayInfoAboutBalances) { displayBalanceInformation(ctx, conversation); } if (displayInfoAboutCash) { displayTerminalCashInformation(ctx, conversation, serialNumbers); } return true; }else { conversation.sendText("Invalid parameters. See help for more information."); } return true; }