@Test
public void testCaseInsensitive() {

  String[] keywords = { "foo", "bar", "baz" };
  Terminals terminals =
      Terminals.operators("+", "-").words(Scanners.IDENTIFIER).caseInsensitiveKeywords(asList(keywords)).build();
  Parser<Token> parser =
      terminals.token("+", "-", "foo", "bar").from(terminals.tokenizer(), WHITESPACES);
  assertEquals(new Token(0, 1, Tokens.reserved("+")), parser.parse("+"));
  assertEquals(new Token(0, 1, Tokens.reserved("-")), parser.parse("-"));
  assertEquals(new Token(0, 3, Tokens.reserved("foo")), parser.parse("foo"));
  assertEquals(new Token(0, 3, Tokens.reserved("foo")), parser.parse("Foo"));
  assertEquals(new Token(0, 3, Tokens.reserved("bar")), parser.parse("bar"));
  assertFailure(mode, parser, "baz", 1, 1, "+, -, foo or bar expected, baz encountered.");
  assertFailure(mode, parser, "123", 1, 1, "+, -, foo or bar expected, 1 encountered.");
  assertEquals("xxx", Terminals.Identifier.PARSER.from(terminals.tokenizer(), WHITESPACES).parse("xxx"));
}