PsiElementPredicate () { return new PsiElementPredicate() { @Override public boolean satisfiedBy(PsiElement element) { if (!(element instanceof PsiReturnStatement returnStatement)) { return false; } final PsiExpression returnValue = PsiUtil.skipParenthesizedExprDown(returnStatement.getReturnValue()); if (!(returnValue instanceof PsiPolyadicExpression polyadicExpression)) { return false; } final IElementType tokenType = polyadicExpression.getOperationTokenType(); return tokenType == JavaTokenType.ANDAND || tokenType == JavaTokenType.OROR; } }; }