package com.lovecoding.day24.stream01;

import com.lovecoding.day24.function02.Person;
import org.junit.Test;

import java.util.List;
import java.util.stream.Collectors;

public class Test03 {

    @Test
    public void test01(){
        List<Person> people = List.of(new Person("zs"), new Person("zzz"), new Person("ww"));

        List<Person> z = people.stream().filter(e -> e.getName().startsWith("z")).collect(Collectors.toList());

        System.out.println(z);
    }

    @Test
    public void test02(){
        List<Person> people = List.of(new Person("zs"), new Person("zzz"), new Person("ww"));

        long z = people.stream().filter(e -> e.getName().startsWith("z")).count();

        System.out.println(z);
    }


}
