public static List<String> splitToWhiteSpaceSeparatedTokens(String input) {
        if (input == null) {
            return new ArrayList<>();
        }
        StringTokenizer tokenizer = new StringTokenizer(input.trim(), QUOTE_CHAR + WHITESPACE, true);
        List<String> tokens = new ArrayList<>();

        StringBuilder quotedText = new StringBuilder();

        while (tokenizer.hasMoreTokens()) {
            String token = tokenizer.nextToken();
            if (QUOTE_CHAR.equals(token)) {
                // if we have a quote, add the next tokens to the quoted text
                // until the quoting has finished
                quotedText.append(QUOTE_CHAR);
                String buffer = quotedText.toString();
                if (isSingleQuoted(buffer) || isDoubleQuoted(buffer)) {
                    tokens.add(buffer.substring(1, buffer.length() - 1));
                    quotedText = new StringBuilder();
                }
            } else if (WHITESPACE.equals(token)) {
                // a white space, if in quote, add the white space, otherwise
                // skip it
                if (quotedText.length() > 0) {
                    quotedText.append(WHITESPACE);
                }
            } else {
                if (quotedText.length() > 0) {
                    quotedText.append(token);
                } else {
                    tokens.add(token);
                }
            }
        }
        if (quotedText.length() > 0) {
            throw new IllegalArgumentException("Invalid quoting found in args " + quotedText);
        }
        return tokens;
    }
@Test
    public void testDoubleQuoteAndSpace() {
        List<String> args = splitToWhiteSpaceSeparatedTokens("\"\"arg0\"\" arg1");
        assertEquals("\"arg0\"", args.get(0));
        assertEquals("arg1", args.get(1));
    }