@Test
public void testJoinWithFunction() {

    final Collection.Function<Integer, String> parityFunction = x -> x % 2 == 0 ? "even" : "odd";
    final ArrayList<Integer> list = new ArrayList<>();
    assertEquals("", Collection.join(list, ",", parityFunction));
    list.add(1);
    assertEquals("odd", Collection.join(list, ",", parityFunction));
    list.add(2);
    assertEquals("odd,even", Collection.join(list, ",", parityFunction));
    assertEquals("odd:sep:even", Collection.join(list, ":sep:", parityFunction));
    assertEquals("oddeven", Collection.join(list, "", parityFunction));
}