SuppressFix (final @NotNull String id) { return new SuppressFix(id) { @Override @SuppressWarnings({"SimplifiableIfStatement"}) public boolean isAvailable(final @NotNull Project project, final @NotNull PsiElement context) { if (getContainer(context) instanceof PsiClass) return false; return super.isAvailable(project, context); } @Override protected boolean use15Suppressions(final @NotNull PsiJavaDocumentedElement container) { return true; } }; }