mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
fix test
This commit is contained in:
parent
d343051db5
commit
2a8444b11f
@ -1189,7 +1189,7 @@ public class CollUtil {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
int initSize = Math.min(collection.size(), size);
|
final int initSize = Math.min(collection.size(), size);
|
||||||
List<T> subList = new ArrayList<>(initSize);
|
List<T> subList = new ArrayList<>(initSize);
|
||||||
for (T t : collection) {
|
for (T t : collection) {
|
||||||
if (subList.size() >= size) {
|
if (subList.size() >= size) {
|
||||||
|
@ -259,8 +259,8 @@ public class CollUtilTest {
|
|||||||
public void splitTest2() {
|
public void splitTest2() {
|
||||||
final ArrayList<Integer> list = CollUtil.newArrayList(1, 2, 3, 4, 5, 6, 7, 8, 9);
|
final ArrayList<Integer> list = CollUtil.newArrayList(1, 2, 3, 4, 5, 6, 7, 8, 9);
|
||||||
final List<List<Integer>> split = CollUtil.split(list, Integer.MAX_VALUE);
|
final List<List<Integer>> split = CollUtil.split(list, Integer.MAX_VALUE);
|
||||||
Assert.assertEquals(3, split.size());
|
Assert.assertEquals(1, split.size());
|
||||||
Assert.assertEquals(3, split.get(0).size());
|
Assert.assertEquals(9, split.get(0).size());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
Loading…
x
Reference in New Issue
Block a user