mirror of
https://gitee.com/dromara/hutool.git
synced 2025-04-24 18:04:54 +08:00
add testr
This commit is contained in:
parent
2bcb8f3f79
commit
7646683785
@ -912,4 +912,17 @@ public class CollUtilTest {
|
||||
Console.log(collection.getClass());
|
||||
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…
Reference in New Issue
Block a user