@Test
public void testSepEndBy1() {

  Parser<List<Integer>> parser = INTEGER.sepEndBy1(COMMA);
  assertListParser(parser, "1,2", 1, 2);
  assertListParser(parser, "1", 1);
  assertListParser(parser, "1,", 1);
  assertFailure(mode, parser, ",", 1, 1);
  assertFailure(mode, parser, "", 1, 1);
  assertFailure(mode, parser.next(Parsers.EOF), "1,,", 1, 3);
  assertFailure(mode, areChars("ab").sepEndBy1(isChar(';')), "ab;a", 1, 5);
  
  // atomize on delimiter
  assertListParser(INTEGER.sepEndBy1(COMMA.next(COMMA).atomic()).followedBy(COMMA),
      "1,", 1);
  
  // 0 step partial delimiter consumption
  assertListParser(INTEGER.sepEndBy1(COMMA.asDelimiter().next(COMMA)).followedBy(COMMA),
      "1,", 1);
  
  // partial delimiter consumption
  assertFailure(mode, INTEGER.sepEndBy1(COMMA.next(COMMA)), "1,", 1, 3, ", expected, EOF encountered.");
  
  // infinite loop.
  assertListParser(Parsers.always().sepEndBy1(Parsers.always()), "", (Integer) null);
  
  // partial consumption on delimited.
  assertFailure(mode, INTEGER.followedBy(COMMA).sepEndBy1(COMMA),
      "1,,1", 1, 5, ", expected, EOF encountered.");
  
  // 0 step partial delimited consumption
  assertListParser(INTEGER.asDelimiter().followedBy(COMMA).sepEndBy1(COMMA).followedBy(string("1"))
      , "1,,1", 1);
}