Mask Email Address in Salesforce Using Apex

Sample Code:

String emailaddress = 'itzbiswajeet@gmail.com';
System.debug(emailaddress.replaceAll('(^[^@]{2}|(?!^)\\G)[^@]', '$1*'));