boolean (@NotNull PsiElement element) { PsiElement parent = element.getParent(); if (!(parent instanceof GrMethod method) || ((GrMethod)parent).getNameIdentifierGroovy() != element) return false; GrOpenBlock block = method.getBlock(); if (block == null) return false; GrStatement[] statements = block.getStatements(); if (statements.length != 1) return false; if (!GroovyPropertyUtils.isSimplePropertyGetter(method)) return false; if (GroovyPropertyUtils.findFieldForAccessor(method, true) != null) return false; GrStatement statement = statements[0]; if (!(statement instanceof GrReturnStatement && ((GrReturnStatement)statement).getReturnValue() != null || statement instanceof GrExpression && !PsiTypes.voidType().equals(((GrExpression)statement).getType()))) { return false; } return true; }