mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
修复CollUtil.containsAll在coll2长度大于coll1时逻辑歧义问题
This commit is contained in:
@@ -408,7 +408,7 @@ public class CollUtilTest {
|
||||
public void groupTest() {
|
||||
final List<String> list = ListUtil.of("1", "2", "3", "4", "5", "6");
|
||||
final List<List<String>> group = CollUtil.group(list, null);
|
||||
Assertions.assertTrue(group.size() > 0);
|
||||
Assertions.assertFalse(group.isEmpty());
|
||||
|
||||
final List<List<String>> group2 = CollUtil.group(list, t -> {
|
||||
// 按照奇数偶数分类
|
||||
@@ -1266,4 +1266,20 @@ public class CollUtilTest {
|
||||
Assertions.assertArrayEquals(new String[]{"a", "b", "c", null, "d", "e", "f", "g", "h", "i", "j", "k", "l"}, flat.toArray());
|
||||
}
|
||||
|
||||
@Test
|
||||
void issueI8Z2Q4Test() {
|
||||
final ArrayList<String> coll1 = new ArrayList<>();
|
||||
coll1.add("1");
|
||||
coll1.add("2");
|
||||
coll1.add("3");
|
||||
coll1.add("4");
|
||||
final ArrayList<String> coll2 = new ArrayList<>();
|
||||
coll2.add("1");
|
||||
coll2.add("1");
|
||||
coll2.add("1");
|
||||
coll2.add("1");
|
||||
coll2.add("1");
|
||||
|
||||
Assertions.assertTrue(CollUtil.containsAll(coll1, coll2));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user