// "Convert to local variables" "true-preview" import java.util.*; class Foo { void test2() { List x1 = new ArrayList<>(); System.out.println(x1); Runnable r = () -> { List x = new ArrayList<>(); // could be local System.out.println(x); }; } }