### Question:
CommandTable { protected int parameterCount(List<Token> tokens) { if(Token.isCustomizedParamOrder(tokens)){ return (tokens.size() - 1) / 2; } return tokens.size() - 1; } CommandTable(CommandNamer namer); void setMessageResolver(MessageResolver messageResolver); CommandNamer getNamer(); List<ShellCommand> getCommandTable(); void removeCommands(Object handler); void addMethod(Method method, Object handler, String prefix); void addCommand(CommandDefinition definition); List<ShellCommand> commandsByName(String discriminator); ShellCommand lookupCommand(String discriminator, List<Token> tokens, InputConversionEngine inputEngine); void refreshCommands();  }### Answer:
@Test public void parameterCount(){ CommandTable cmdTable = new CommandTable(null); assertEquals(0, cmdTable.parameterCount(Arrays.asList( new Token(0, "cmd")))); assertEquals(1, cmdTable.parameterCount(Arrays.asList( new Token(0, "cmd"), new Token(1, "param")))); assertEquals(2, cmdTable.parameterCount(Arrays.asList( new Token(0, "cmd"), new Token(1, "param1"), new Token(2, "param2")))); assertEquals(1, cmdTable.parameterCount(Arrays.asList( new Token(0, "cmd"), new Token(1, "--param"), new Token(2, "paramValue")))); assertEquals(2, cmdTable.parameterCount(Arrays.asList( new Token(0, "cmd"), new Token(1, "\"--param\""), new Token(2, "paramValue")))); }