private static PsiMethod getSelectedMethod(Editor editor, PsiFile file) {
        final int caret = editor.getCaretModel().getOffset();
        final PsiElement elementAt = file.findElementAt(caret);
        return MethodUtils.getJavaMethodFromHeader(elementAt);
    }
private static PsiMethod getSelectedMethod(Editor editor, PsiFile file)