@Test
public void search() {

  UriTokenizer tokenizer = new UriTokenizer("a AND b OR NOT \"c\" d");
  assertTrue(tokenizer.next(TokenKind.Word));
  assertTrue(tokenizer.next(TokenKind.AndOperatorSearch));
  assertTrue(tokenizer.next(TokenKind.Word));
  assertFalse(tokenizer.next(TokenKind.AndOperatorSearch));
  assertTrue(tokenizer.next(TokenKind.OrOperatorSearch));
  assertTrue(tokenizer.next(TokenKind.NotOperatorSearch));
  assertTrue(tokenizer.next(TokenKind.Phrase));
  assertTrue(tokenizer.next(TokenKind.AndOperatorSearch));
  assertTrue(tokenizer.next(TokenKind.Word));
  assertFalse(tokenizer.next(TokenKind.AndOperatorSearch));
  assertFalse(tokenizer.next(TokenKind.Word));
  assertFalse(tokenizer.next(TokenKind.Phrase));
  assertTrue(tokenizer.next(TokenKind.EOF));
  assertTrue(new UriTokenizer("\"a\\\\x\\\"\"").next(TokenKind.Phrase));
  assertFalse(new UriTokenizer("\"a\\\"").next(TokenKind.Phrase));
  assertFalse(new UriTokenizer("\"a\\x\"").next(TokenKind.Phrase));
  wrongToken(TokenKind.Phrase, "\"a\"", '\\');
  final String outsideBmpLetter = String.valueOf(Character.toChars(0x10330));
  assertTrue(new UriTokenizer("\"" + outsideBmpLetter + "\"").next(TokenKind.Phrase));
  assertTrue(new UriTokenizer(outsideBmpLetter).next(TokenKind.Word));
  assertFalse(new UriTokenizer("1").next(TokenKind.Word));
  assertFalse(new UriTokenizer("AND").next(TokenKind.Word));
  assertFalse(new UriTokenizer("OR").next(TokenKind.Word));
  assertFalse(new UriTokenizer("NOT").next(TokenKind.Word));
}