List of usage examples for org.apache.commons.collections4 TransformerUtils nullTransformer
public static <I, O> Transformer<I, O> nullTransformer()
From source file:com.feilong.core.util.CollectionsUtilTest.java
/** * Test collect.//w w w . j a va 2 s . co m */ @Test public void testCollect() { List<String> list = toList("xinge", "feilong1", "feilong2", "feilong2"); Transformer<String, Object> nullTransformer = TransformerUtils.nullTransformer(); List<Object> collect = CollectionsUtil.collect(list, nullTransformer); Object[] objects = { null, null, null, null }; assertThat(collect, hasItems(objects)); }