title: Java - how to replace duplicated characters in a string?
body: <p>could someone tell me how to replace duplicated characters by "*" in a string?
  Input is for example: "aacbbbz" - output should be "**c***z"</p>
  
  <p>Thank you.</p>