@Test
public void testToArrayWithIteration() {

  Parser<Integer> p1 = Parsers.constant(1);
  Parser<Integer> p2 = Parsers.constant(2);
  Parser<Integer>[] array = Parsers.toArrayWithIteration(Arrays.asList(p1, p2));
  assertEquals(2, array.length);
  assertSame(p1, array[0]);
  assertSame(p2, array[1]);
}