Android examples for java.util:Collection Filter
filter value from Collection by Predicate
//package com.book2s; import java.util.Collection; import java.util.List; import java.util.function.Predicate; import java.util.stream.Collectors; public class Main { public static <T> List<T> filter(Collection<T> toFilter, Predicate<T> predicate) { return toFilter.stream().filter(predicate) .collect(Collectors.toList()); }//from w w w .j a va2s . c om }