message: Fixed a bug where there are multiple list operations in a operation group
diff: @@ -18,30 +18,34 @@ namespace AutoRest.Java.Azure.Fluent.Model
  {
  public override void Disambiguate()
  {
  - if (this.HttpMethod == HttpMethod.Get)
  - {
  - var url = this.Url.Value;
  - var urlSplits = url.Split('/');
  - if (urlSplits.Count() == 6 || urlSplits.Count() == 8)
  + if (string.IsNullOrWhiteSpace(this.MethodGroup.Name))
  {
  + base.Disambiguate();
  +
  + return;
  + }
  +
  + var methodType = GetMethodType(this);
  var originalName = Name;
  string newName = null;
  - if (urlSplits.Count() == 6 && StringComparer.OrdinalIgnoreCase.Equals(urlSplits[1], "subscriptions"))
  +
  + if (methodType == MethodType.ListBySubscription)
  {
  - if (StringComparer.OrdinalIgnoreCase.Equals(urlSplits[3], "providers"))
  + var otherListBySubMethods = this.MethodGroup.Methods.Where(x => GetMethodType(x as MethodJvaf) == MethodType.ListBySubscription);
  + if (otherListBySubMethods.Count() == 1)
  {
  newName = "List";
  }
  - else
  - {
  - newName = "ListByResourceGroup";
  - }
  }
  - else if (urlSplits.Count() == 8 && StringComparer.OrdinalIgnoreCase.Equals(urlSplits[1], "subscriptions")
  - && StringComparer.OrdinalIgnoreCase.Equals(urlSplits[3], "resourceGroups"))
  + if (methodType == MethodType.ListByResourceGroup)
  + {
  + var otherListByResourceGroupMethods = this.MethodGroup.Methods.Where(x => GetMethodType(x as MethodJvaf) == MethodType.ListByResourceGroup);
  + if (otherListByResourceGroupMethods.Count() == 1)
  {
  newName = "ListByResourceGroup";
  }
  + }
  +
  if (!string.IsNullOrWhiteSpace(newName))
  {
  this.SimulateAsPagingOperation = true;
  @@ -52,8 +56,7 @@ namespace AutoRest.Java.Azure.Fluent.Model
  }
  return;
  }
  - }
  - }
  +
  base.Disambiguate();
  }
  @@ -190,5 +193,41 @@ namespace AutoRest.Java.Azure.Fluent.Model
  return imports;
  }
  }
  +
  + private enum MethodType
  + {
  + Other,
  + ListBySubscription,
  + ListByResourceGroup
  + }
  +
  + private static MethodType GetMethodType(MethodJvaf method)
  + {
  + if (method.HttpMethod == HttpMethod.Get)
  + {
  + var url = method.Url.Value;
  + var urlSplits = url.Split('/');
  + if ((urlSplits.Count() == 6 || urlSplits.Count() == 8) && StringComparer.OrdinalIgnoreCase.Equals(urlSplits[1], "subscriptions"))
  + {
  + if (urlSplits.Count() == 6)
  + {
  + if (StringComparer.OrdinalIgnoreCase.Equals(urlSplits[3], "providers"))
  + {
  + return MethodType.ListBySubscription;
  + }
  + else
  + {
  + return MethodType.ListByResourceGroup;
  + }
  + }
  + else if (StringComparer.OrdinalIgnoreCase.Equals(urlSplits[3], "resourceGroups"))
  + {
  + return MethodType.ListByResourceGroup;
  + }
  + }
  + }
  +
  + return MethodType.Other;
  + }
  }
  }
  \ No newline at end of file
  