修复CollUtil.reverseNew针对非可变列表异常

This commit is contained in:
Looly
2023-04-14 22:55:16 +08:00
parent 74bf08c5ac
commit 5d82f07936
3 changed files with 16 additions and 2 deletions

View File

@@ -254,4 +254,11 @@ public class ListUtilTest {
ListUtil.setOrPadding(list, 3, "a");
Assert.assertEquals(4, list.size());
}
@Test
public void reverseNewTest() {
final List<Integer> view = ListUtil.of(1, 2, 3);
final List<Integer> reverse = ListUtil.reverseNew(view);
Assert.assertEquals("[3, 2, 1]", reverse.toString());
}
}