void () { myFixture.enableInspections(new UnusedImportInspection()); myFixture.configureByText("a.java", """ package p; // just remove, not reorganize import java.util.List; import java.util.HashSet; // this for sure import java.<caret>util.Set; import java.util.ArrayList; import java.util.HashMap; class X { List a = new ArrayList(); } """); myFixture.launchAction(myFixture.findSingleIntention(JavaErrorBundle.message("remove.unused.imports.quickfix.text"))); myFixture.checkResult(""" package p; // just remove, not reorganize import java.util.List; // this for sure import java.util.ArrayList; class X { List a = new ArrayList(); } """); }