void (String[] args, String s) { Collection<String> strings = new ArrayList<>(); new Object() { public void foo(String s) { System.out.println( s.hashCode()); } }; System.out.println(<selection>s.hashCode()</selection>); }