@@ -0,0 +1,2608 @@
+package org.petitparser.utils;%0A%0Aimport org.junit.Test;%0A%0Aimport java.util.List;%0A%0Aimport static java.util.Arrays.asList;%0Aimport static org.junit.Assert.assertEquals;%0Aimport static org.petitparser.utils.Functions.constant;%0Aimport static org.petitparser.utils.Functions.firstOfList;%0Aimport static org.petitparser.utils.Functions.lastOfList;%0Aimport static org.petitparser.utils.Functions.nthOfList;%0Aimport static org.petitparser.utils.Functions.permutationOfList;%0Aimport static org.petitparser.utils.Functions.withoutSeparators;%0A%0A/**%0A * Tests %7B@link Functions%7D.%0A */%0Apublic class FunctionsTest %7B%0A%0A  static final List%3CObject%3E EMPTY = asList();%0A  static final List%3CObject%3E ONE = asList('a');%0A  static final List%3CObject%3E TWO = asList('a', 'b');%0A  static final List%3CObject%3E THREE = asList('a', 'b', 'c');%0A%0A  @Test%0A  public void testFirstOfList() %7B%0A    assertEquals('a', firstOfList().apply(ONE));%0A    assertEquals('a', firstOfList().apply(TWO));%0A    assertEquals('a', firstOfList().apply(THREE));%0A  %7D%0A%0A  @Test%0A  public void testLastOfList() %7B%0A    assertEquals('a', lastOfList().apply(ONE));%0A    assertEquals('b', lastOfList().apply(TWO));%0A    assertEquals('c', lastOfList().apply(THREE));%0A  %7D%0A%0A  @Test%0A  public void testNthOfListOfList() %7B%0A    assertEquals('a', nthOfList(0).apply(ONE));%0A    assertEquals('a', nthOfList(0).apply(TWO));%0A    assertEquals('a', nthOfList(0).apply(THREE));%0A%0A    assertEquals('b', nthOfList(1).apply(TWO));%0A    assertEquals('b', nthOfList(1).apply(THREE));%0A%0A    assertEquals('c', nthOfList(2).apply(THREE));%0A%0A    assertEquals('a', nthOfList(-1).apply(ONE));%0A    assertEquals('b', nthOfList(-1).apply(TWO));%0A    assertEquals('c', nthOfList(-1).apply(THREE));%0A%0A    assertEquals('a', nthOfList(-2).apply(TWO));%0A    assertEquals('b', nthOfList(-2).apply(THREE));%0A%0A    assertEquals('a', nthOfList(-3).apply(THREE));%0A  %7D%0A%0A  @Test%0A  public void testPermutationOfList() %7B%0A    assertEquals(EMPTY, permutationOfList().apply(EMPTY));%0A    assertEquals(EMPTY, permutationOfList().apply(THREE));%0A    assertEquals(asList('c', 'a'), permutationOfList(-1, 0).apply(THREE));%0A    assertEquals(asList('a', 'a'), permutationOfList(-3, 0).apply(THREE));%0A  %7D%0A%0A  @Test%0A  public void testWithoutSeparators() %7B%0A    assertEquals(EMPTY, withoutSeparators().apply(EMPTY));%0A    assertEquals(ONE, withoutSeparators().apply(ONE));%0A    assertEquals(ONE, withoutSeparators().apply(TWO));%0A    assertEquals(asList('a', 'c'), withoutSeparators().apply(THREE));%0A  %7D%0A%0A  @Test%0A  public void testConstant() %7B%0A    assertEquals((Object) 'a', constant('a').apply('b'));%0A    assertEquals((Object) 'b', constant('b').apply('c'));%0A  %7D%0A%7D%0A

Add missing tests for functions.