PsiMethodCallExpression (PsiMethodCallExpression methodCallExpression) { PsiMethodCallExpression nextCall = ExpressionUtils.getCallForQualifier(methodCallExpression); if (nextCall == null) return null; String nextName = nextCall.getMethodExpression().getReferenceName(); if (nextName == null || !Holder.NEXT_METHODS.contains(nextName) || translateName(methodCallExpression, nextCall) == null) return null; PsiExpressionList argumentList = (nextCall).getArgumentList(); PsiExpression[] expressions = argumentList.getExpressions(); if(expressions.length == 0) { if (!nextName.equals("boxed") && !nextName.equals("asLongStream") && !nextName.equals("asDoubleStream")) return null; return nextCall; } if (expressions.length != 1 || !StreamRefactoringUtil.isRefactoringCandidate(expressions[0], false)) return null; return nextCall; }