void () { final UnnecessaryFinalOnLocalVariableOrParameterInspection inspection = new UnnecessaryFinalOnLocalVariableOrParameterInspection(); inspection.reportLocalVariables = false; myFixture.enableInspections(inspection); doTest(""" import java.io.*; import java.util.*; class FinalTest { public List<String> foobar(/*Unnecessary 'final' on parameter 'shouldBeNonFinal'*/final/**/ String shouldBeNonFinal) throws IOException { List<String> finalVar = new ArrayList<>(); try (final BufferedReader reader = new BufferedReader(new FileReader(""))) { for (String nonFinalVar = reader.readLine(); nonFinalVar != null; nonFinalVar = reader.readLine()) { finalVar.add(nonFinalVar); } } for (/*Unnecessary 'final' on parameter 's'*/final/**/ String s : finalVar) { } for (final Iterator<String> it = finalVar.iterator(); it.hasNext(); ) { if (it.next() == null) { System.out.println("deleting"); it.remove(); } } return finalVar; } }"""); }