boolean (PsiStatement statement) { if (!(statement instanceof PsiReturnStatement returnStatement)) { return false; } final PsiExpression returnValue = PsiUtil.skipParenthesizedExprDown(returnStatement.getReturnValue()); if (returnValue == null || returnValue instanceof PsiLiteralExpression) { return false; } final PsiType returnType = returnValue.getType(); return PsiTypes.booleanType().equals(returnType); }