LocalQuickFix (Object... infos) { if (infos.length != 1) return null; PsiLocalVariable localVariable = tryCast(infos[0], PsiLocalVariable.class); if (localVariable == null) return null; PsiType[] parameters = CollectionReplaceableByEnumCollectionVisitor.extractParameterType(localVariable, 1); if (parameters == null) return null; PsiType enumParameter = parameters[0]; PsiClass probablyEnum = PsiUtil.resolveClassInClassTypeOnly(enumParameter); if (probablyEnum == null || !probablyEnum.isEnum()) return null; String text = "java.util.EnumSet.noneOf(" + enumParameter.getCanonicalText() + ".class)"; return new ReplaceExpressionWithTextFix(text, CommonQuickFixBundle.message("fix.replace.with.x", "EnumSet")); }