package com.
java8;
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
public class UseOfStreamApi {
public static void main(String[] args) {
// TODO Auto-generated method stub
ArrayList<Integer> a=new ArrayList<Integer>([Link](10,20,30,40,50));
//program to take out the list no greater than 20
List<Integer> collect = [Link]().filter(i->i>20).collect([Link]());
[Link](collect);
//program to take out the list where we are adding 5 to each element in list
List<Integer> collect2 = [Link]().map(i->i+5).collect([Link]());
[Link](collect2);
//define stream with [Link]()
Stream <Integer> s1= [Link](1,2,3,4,5);
[Link](i->[Link](i+" "));
//use of minimum maximum
Stream <Integer> s2= [Link](1,2,3,4,5);
Integer integer = [Link]((o1,o2)->[Link](o2)).get();
[Link]();