mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
add testr
This commit is contained in:
parent
2bcb8f3f79
commit
7646683785
@ -912,4 +912,17 @@ public class CollUtilTest {
|
|||||||
Console.log(collection.getClass());
|
Console.log(collection.getClass());
|
||||||
Assert.assertNotNull(collection);
|
Assert.assertNotNull(collection);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void transTest(){
|
||||||
|
final List<Person> people = Arrays.asList(
|
||||||
|
new Person("aa", 12, "man", 1),
|
||||||
|
new Person("bb", 13, "woman", 2),
|
||||||
|
new Person("cc", 14, "man", 3),
|
||||||
|
new Person("dd", 15, "woman", 4)
|
||||||
|
);
|
||||||
|
|
||||||
|
final Collection<String> trans = CollUtil.trans(people, Person::getName);
|
||||||
|
Assert.assertEquals("[aa, bb, cc, dd]", trans.toString());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user