### Question:
StringFormatUtil { public static String makeToken(String input, String replacement) { String result = input; result = new String(StandardCharsets.US_ASCII.encode(result).array(), StandardCharsets.US_ASCII); result = result.replaceAll("\\s", replacement); result = result.replaceAll("[^\\x20-\\x7f]", replacement); result = result.replaceAll("[()<>@,;:\\\\\\\"/\\[\\]?=]", replacement); return result; } private  StringFormatUtil(); static String formatFilesize(String filesize, int decimalPlaces); static String formatFilesize(long filesize, int decimalPlaces); static String truncateText(String text, int length); static String urlEncode(String value); static String removeQueryParameter(String query, String key); static String makeToken(String input, String replacement);  }### Answer:
@Test public void makeTokenTest() { assertEquals("blah", StringFormatUtil.makeToken("blah", "_")); assertEquals("caf_", StringFormatUtil.makeToken("café", "_")); assertEquals("lorem_ipsum_", StringFormatUtil.makeToken("lorem ipsum?", "_")); assertEquals("lorem__ipsum_", StringFormatUtil.makeToken("lorem? ipsum?", "_")); assertEquals("lorem___ipsum", StringFormatUtil.makeToken("lorem; ipsum", "_")); }