mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-12-07 01:28:34 +08:00
add test
This commit is contained in:
parent
29902b9093
commit
fa238bc4c9
@ -1516,4 +1516,20 @@ public class CollUtilTest {
|
|||||||
|
|
||||||
assertTrue(CollUtil.containsAll(coll1, coll2));
|
assertTrue(CollUtil.containsAll(coll1, coll2));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void finOneTest(){
|
||||||
|
Animal dog = new Animal("dog", 2);
|
||||||
|
Animal cat = new Animal("cat", 3);
|
||||||
|
Animal bear = new Animal("bear", 4);
|
||||||
|
|
||||||
|
List<Animal> list = new ArrayList<>();
|
||||||
|
list.add(dog);
|
||||||
|
list.add(cat);
|
||||||
|
list.add(bear);
|
||||||
|
|
||||||
|
final Animal cat1 = CollUtil.findOne(list, (t) -> t.getName().equals("cat"));
|
||||||
|
assertNotNull(cat1);
|
||||||
|
assertEquals("cat", cat1.getName());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user