private static @Nullable PsiExpression getBaseCollection(@NotNull PsiExpression derivedCollection) {
    while(true) {
      PsiMethodCallExpression derivedCall =
        ObjectUtils.tryCast(PsiUtil.skipParenthesizedExprDown(derivedCollection), PsiMethodCallExpression.class);
      if (DERIVED_COLLECTION.test(derivedCall)) {
        derivedCollection = ExpressionUtils.getEffectiveQualifier(derivedCall.getMethodExpression());
      }
      else {
        return derivedCollection;
      }
    }
  }
private static @Nullable PsiExpression getBaseCollection(@NotNull PsiExpression derivedCollection)