### Question:
ShellSplitter { List<String> split(final String commandLine) throws ShellSplitterException { if (commandLine == null) { return null; } ensureFields(); for (int i = 0; i < commandLine.length(); i++) { char c = commandLine.charAt(i); processCharacter(c); } addLastToken(); if (quoting || escaping) { final String errorMessage = String.format("Unable to parse command %s", commandLine); throw new ShellSplitterException(errorMessage); } return tokens; }    }### Answer:
@Test public void test() throws ShellSplitterException { if (expectedExceptionClass != null) { expectedException.expect(expectedExceptionClass); shellSplitter.split(input); } else { assertEquals("Invalid splitting", expectedOutput, shellSplitter.split(input)); } }