add methods

This commit is contained in:
Looly
2020-03-26 17:15:43 +08:00
parent 8bb73f3829
commit 85eab64171
4 changed files with 45 additions and 28 deletions

View File

@@ -0,0 +1,18 @@
package cn.hutool.core.collection;
import org.junit.Assert;
import org.junit.Test;
import java.util.List;
public class ListUtilTest {
@Test
public void filterTest(){
List<String> a = ListUtil.toLinkedList("1", "2", "3");
final List<String> filter = ListUtil.filter(a, str -> "edit" + str);
Assert.assertEquals("edit1", filter.get(0));
Assert.assertEquals("edit2", filter.get(1));
Assert.assertEquals("edit3", filter.get(2));
}
}