@Test
public void testMap() {

  List<String> list = newTestList();
  Collection<String> mapped = map(list, new Function<String, String>() {
    @Override
    public String apply(String s) {
      return s + s;
    }
  });
  assertSame(mapped.getClass(), list.getClass());
  assertTrue(list.contains("one"));
  assertTrue(list.contains("two"));
  assertTrue(mapped.contains("oneone"));
  assertTrue(mapped.contains("twotwo"));
  assertEquals(2, list.size());
  assertEquals(2, mapped.size());
}