Package java8

Source Code of java8.Lambda

package java8;

import java.util.List;
import java.util.stream.Stream;

import com.google.common.collect.ImmutableList;
import com.phanindra.domain.Person;

public class Lambda {
  public static void main(String args[]) {
    List<Person> people = ImmutableList.of(new Person().setName("Phanindra"), new Person().setName("Padmashree"));
    Stream<Person> filteredPeopleStrem = people.stream().filter(p -> p.getName().startsWith("P"));
    System.out.println(filteredPeopleStrem.count());
  }
}
TOP

Related Classes of java8.Lambda

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.