The StringTokenizer API is tricky. Each character in the delimiters are characters not a sequence. That means " x" splits on spaces OR x. That's why you get the three tokens - there are there are two spaces so three portions.
For the second example " a" splits on spaces or a. Which is all the characters.