@Test
public void testFlatMap() {

  List<Integer> mapped = mlist(new Integer[]{1, 2, 3}).flatMap(new Function<Integer, Collection<Integer>>() {
    @Override public Collection<Integer> apply(Integer a) {
      return asList(a, a);
    }
  }).value();
  assertEquals(6, mapped.size());
  assertEquals(new Integer(1), mapped.get(0));
  assertEquals(new Integer(2), mapped.get(2));
  assertEquals(new Integer(3), mapped.get(4));
}