void (@NotNull PsiReturnStatement statement) { final PsiMethod method; final PsiType type; final boolean tailTypeSemicolon; final NavigatablePsiElement psiElement = PsiTreeUtil.getParentOfType(statement, PsiLambdaExpression.class, PsiMethod.class); if (psiElement instanceof PsiLambdaExpression) { final PsiType functionalInterfaceType = ((PsiLambdaExpression)psiElement).getFunctionalInterfaceType(); method = LambdaUtil.getFunctionalInterfaceMethod(functionalInterfaceType); type = LambdaUtil.getFunctionalInterfaceReturnType(functionalInterfaceType); tailTypeSemicolon = LambdaHighlightingUtil.insertSemicolonAfter((PsiLambdaExpression)psiElement); } else if (psiElement instanceof PsiMethod) { method = (PsiMethod)psiElement; type = method.getReturnType(); tailTypeSemicolon = true; } else { method = null; type = null; tailTypeSemicolon = true; } if (method != null) { visitMethodReturnType(method, type, tailTypeSemicolon); } }