boolean (@Nullable String guardText, @NotNull PsiElement context) { if (guardText == null || "itself".equals(guardText)) { return false; } try { final JavaPsiFacade facade = JavaPsiFacade.getInstance(context.getProject()); final PsiExpression expression = facade.getElementFactory().createExpressionFromText(guardText, context); return isValidGuard(expression, context); } catch (IncorrectOperationException ignore) { return false; } }