Application/Java8

Lista:
-----------------------
----------------------------
1) Map and Collect to List (Buzzwords: map + collect)
-------------------
public static Collection<String> mapToUppercase(String... names) {
	
	Arrays.asList(names).stream().map(x->x.toUpperCase()).collect(Collectors.toList());
}
2) Filter names longer than 5, and collect the rest's total count
------------------------
return Arrays.asList(names).stream().filter(x->x.length()>5).mapToInt(x -> x.length()).sum();
3) flatMap
-------------------------
return collection.stream().flatMap(Collection::stream).collect(Collectors.toList());
4) max/min Comparator
--------------
return people.stream().max(Comparator.comparing(Person::getAge)).get();
5) Reduce
return numbers.stream().reduce(0,(a,b)->a+b);
6) get NAme of everyone under the age of 18
return people.stream().filter(x->x.getAge()<18).map(Person::getName).collect(toSet());
7) partitioningBy 
people.stream().collect(partitioningBy(x->x.getAge()>18));
8) groupingBy
return people.stream().collect(groupingBy(Person::getNationality));
9) joining
return people.stream().map(Person::getName).collect(joining(", ","Names: ","."));
10) Ternary Operator
list.stream().map(i -> i % 2 == 0 ? "e" + i : "o" + i).collect(joining(","));