### Question:
QuotedStringTokenizer { public static Builder builder() { return new Builder(); } QuotedStringTokenizer(String stringToTokenize);  QuotedStringTokenizer(String stringToTokenize, boolean includeQuotes);  QuotedStringTokenizer(String stringToTokenize, String quoteChars, boolean includeQuotes);  QuotedStringTokenizer(String stringToTokenize, String quoteChars, boolean includeQuotes, String delimiters, boolean includeDelimiters); static Builder builder(); synchronized boolean hasMoreTokens(); synchronized String nextToken(); String unquoteToken(String word); String quoteToken(String unescapedText); static boolean hasOpenQuote(String stringToCheck); static boolean hasOpenQuote(String stringToCheck, String quoteChars); List<String> remainderAsList(); static String DEFAULT_QUOTE_CHARS; final static String DEFAULT_DELIMITERS; }### Answer:
@Test public void testTokenizingBuilder() throws Exception { Assert.assertEquals(Arrays.asList("foo", "bar"), QuotedStringTokenizer.builder().buildList("foo bar")); Assert.assertEquals(Arrays.asList("foo,bar"), QuotedStringTokenizer.builder().buildList("foo,bar")); Assert.assertEquals(Arrays.asList("foo", "bar"), QuotedStringTokenizer.builder().delimiterChars(",").buildList("foo,bar")); Assert.assertEquals(Arrays.asList("foo", " bar"), QuotedStringTokenizer.builder().delimiterChars(",").buildList("foo, bar")); Assert.assertEquals(Arrays.asList("foo", "bar"), QuotedStringTokenizer.builder().addDelimiterChars(",").buildList("foo, bar")); }
@Test public void testCommaInQuotes() throws Exception { List<String> l = QuotedStringTokenizer.builder().addDelimiterChars(",").buildList("location1,byon:(hosts=\"loc2,loc3\"),location4"); Assert.assertEquals(Arrays.asList("location1", "byon:(hosts=\"loc2,loc3\")", "location4"), l); }
@Test(enabled=false) public void testCommaInParentheses() throws Exception { List<String> l = QuotedStringTokenizer.builder().addDelimiterChars(",").buildList("location1, byon:(hosts=\"loc2,loc3\",user=foo),location4"); Assert.assertEquals(Arrays.asList("location1", "byon:(hosts=\"loc2,loc3\",user=foo)", "location4"), l); }