How to use $token_service->replace? I am using following code to replace current-user:email token. 

 $pattern = '[current-user:mail]';
 $output = $token_service-&gt;replace($pattern, array('current-user' =&gt; $account), array(
            'clear' =&gt; TRUE,
            'callback' =&gt; xyz_function($pattern_array),
          ));


In the callback function i am doing 

foreach ($replacements as $token =&gt; $value) {
  $replacements[$token] = _cleanstring($value);
}


I guess i am passing wrong array('current-user' => $account) argument. Where am i doing wrong?
Tokens for the current user [current-user:*] don't need any data. Leave the array empty.

What you might referring to are tokens for any user [user:*]. They need an account as parameter 'user'.