PsiMethodCallExpression (PsiMethodCallExpression afterLoopAppend, List<PsiElement> refs) { if (refs.size() == 1 && afterLoopAppend == null) { // case like return sb.append(postfix).toString(); PsiMethodCallExpression usage = ExpressionUtils.getCallForQualifier((PsiExpression)refs.get(0)); if (APPEND.test(usage)) { PsiMethodCallExpression nextCall = ExpressionUtils.getCallForQualifier(usage); if (nextCall != null && "toString".equals(nextCall.getMethodExpression().getReferenceName())) { return usage; } } } return null; }