public void test(){
String x;
List list=Arrays.asList(\"a\",\"b\",\"c\",\"d\");
list.forEach(n->{
if(n.equals(\"
effectively final. you can achieve the same more concisely using filter and map.
Optional d = list.stream()
.filter(c -> c.equals("d"))
.findFirst()
.map(c -> "match the value");