When trying to removed duplicate types, the code was also removingoverloaded method. Modified the check so it is more precise.Added regression test.Fix #1000654(cherry picked from commit 7517a037a7219eb494282247dd06df734c688c2b)

When trying to removed duplicate types, the code was also removingoverloaded method. Modified the check so it is more precise.Added regression test.Fix #1000654(cherry picked from commit 7517a037a7219eb494282247dd06df734c688c2b)

When trying to removed duplicate types, the code was also removingoverloaded method. Modified the check so it is more precise.Added regression test.Fix #1000654(cherry picked from commit 7517a037a7219eb494282247dd06df734c688c2b)

When trying to removed duplicate types, the code was also removingoverloaded method. Modified the check so it is more precise.Added regression test.Fix #1000654(cherry picked from commit 7517a037a7219eb494282247dd06df734c688c2b)