package jp.co.unisys.energy.bems.test;
import java.util.Arrays;
import java.util.List;
public class Lamda{
public static void main(String[] args) {
String[] a = new String[] { "lixianzhong", "xiaomu", "lili", "wang" };
List<String> bb = Arrays.asList(a);
// bb.forEach((player) -> System.out.print(player + "; "));
lamda((cc) -> {
if(cc.equals("lixianzhong")) return true;
else if (cc.equals("wang")) return true;
else return false;
}, bb);
}
public static <T> void lamda(Fileter<T> fil, List<T> list) {
list.forEach((player) -> {
System.out.println(player + "\r\n");
if (fil.excute(player)) {
System.out.println("fileter is run...." + player + "\r\n");
}
});
}
}
interface Fileter<T> {
boolean excute(T player);
}