add method

This commit is contained in:
Looly
2021-07-12 19:38:08 +08:00
parent 0ed05e88ef
commit 34af7f5711
5 changed files with 28 additions and 12 deletions

View File

@@ -12,6 +12,12 @@ import java.util.*;
*/
public class IterUtilTest {
@Test
public void getFirstNonNullTest(){
final ArrayList<String> strings = CollUtil.newArrayList(null, null, "123", "456", null);
Assert.assertEquals("123", IterUtil.getFirstNoneNull(strings));
}
@Test
public void fieldValueMapTest() {
ArrayList<Car> carList = CollUtil.newArrayList(new Car("123", "大众"), new Car("345", "奔驰"), new Car("567", "路虎"));