void (String s) { class NonCapturingLocalM2 { private final String s; public NonCapturingLocalM2(String s) { this.s = s; } @Override public String toString() { return this.s; } } class CapturingLocalM2 { private final int i; public CapturingLocalM2(int i) { this.i = i; } @Override public String toString() { return s + ":" + i; } } new NonCapturingLocalM2(s).toString(); new CapturingLocalM2(42).toString(); Callable<String> c1 = new Callable<String>() { @Override public String call() { return null; } }; Callable<String> c2 = new Callable<String>() { @Override public String call() { return s; } }; (c1.call() + c2.call()).length(); }