void (final InlineOptions options, final boolean nonCode, final boolean assertBadReturn) { PsiElement element = TargetElementUtil .findTargetElement(getEditor(), TargetElementUtil.ELEMENT_NAME_ACCEPTED | TargetElementUtil.REFERENCED_ELEMENT_ACCEPTED); final PsiReference ref = getFile().findReferenceAt(getEditor().getCaretModel().getOffset()); if (ref instanceof PsiJavaCodeReferenceElement) { final PsiElement parent = ((PsiJavaCodeReferenceElement)ref).getParent(); if (parent instanceof PsiNewExpression) { element = ((PsiNewExpression)parent).resolveConstructor(); } } PsiReferenceExpression refExpr = ref instanceof PsiReferenceExpression ? (PsiReferenceExpression)ref : null; assertTrue(element instanceof PsiMethod); PsiMethod method = (PsiMethod)element.getNavigationElement(); final boolean condition = InlineMethodProcessor.checkBadReturns(method) && !InlineUtil.allUsagesAreTailCalls(method); if (assertBadReturn) { assertTrue("Bad returns not found", condition); } else { assertFalse("Bad returns found", condition); } final InlineMethodProcessor processor = new InlineMethodProcessor(getProject(), method, refExpr, getEditor(), options.isInlineThisOnly(), nonCode, nonCode, !options.isKeepTheDeclaration()); processor.run(); }