@Test
public void testFrom() {

  List<Token> tokenList = Arrays.asList(new Token(0, 2, 'a'), new Token(2, 3, 4L));
  Parser<Long> parser = Terminals.CharLiteral.PARSER.next(Terminals.LongLiteral.PARSER);
  Parser<List<Token>> lexeme = constant(tokenList);
  assertEquals((Object) 4L, parser.from(lexeme).parse("", mode));
  assertFailure(mode, Terminals.CharLiteral.PARSER.from(constant(Arrays.<Token>asList())),
      "", 1, 1, "character literal expected, EOF encountered.");
  assertListParser(Parsers.ANY_TOKEN.many().from(lexeme), "", 'a', 4L);
  assertFailure(mode, Parsers.ANY_TOKEN.from(lexeme), "abcde", 1, 3);
  assertFailure(mode, Parsers.always().from(Parsers.<List<Token>>fail("foo")), "", 1, 1);
  Parser<String> badParser = Terminals.CharLiteral.PARSER.next(Terminals.Identifier.PARSER);
  assertFailure(mode, badParser.from(lexeme), "aabbb", 1, 3);
}