I have a map such as
m=[
\"james\":\"silly boy\",
\"janny\":\"Crazy girl\",
\"jimmy\":\"funny man\",
\"georges\":\"massive fella\"
];
BTW, here is code which is showing different sorting with and without toLowerCase():
Map m =[ james :"silly boy",
janny :"crazy girl",
jimmy :"Funny man",
georges:"massive fella" ]
Map sorted = m.sort { a, b -> a.value <=> b.value }
println sorted
sorted = m.sort { a, b -> a.value.toLowerCase() <=> b.value.toLowerCase() }
println sorted
And wll print:
[jimmy:Funny man, janny:crazy girl, georges:massive fella, james:silly boy]
[janny:crazy girl, jimmy:Funny man, georges:massive fella, james:silly boy]