import java.util.List; class Foo { void method1(final T[] val) { class Inner { void method2() { for (T t : val) { } } } } }