Finish the method definition given below.
Given a string str
, the method should return the most commonly occurring character in the string. If there are 2 or more such characters, then the method should return the character which comes first alphabetically.
The function should consider uppercase and lowercase characters as the same, and the output should be in lowercase.