@Test
public void testFlatMapTokens() {

    final AFunction1NoThrow<String, List<String>> tokens = new AFunction1NoThrow<String, List<String>>() {
        @Override public List<String> apply(String param) {
            return Arrays.asList (param.split (" "));
        }
    };
    assertEquals(Arrays.<String>asList(), ACollectionHelper.flatMap(Arrays.<String>asList(), tokens));
    assertEquals(Arrays.asList("a"), ACollectionHelper.flatMap (Arrays.asList ("a"), tokens));
    assertEquals(Arrays.asList("a", "bc", "def"), ACollectionHelper.flatMap (Arrays.asList ("a bc def"), tokens));
    assertEquals(Arrays.asList("a", "bc", "def", "x", "yz"), ACollectionHelper.flatMap (Arrays.asList ("a bc def", "x yz"), tokens));
}