### Question:
AcmSolrUtil { public static String encodeSpecialCharactersForACL(String s) { for (char c : solrSpecialCharacters.toCharArray()) { s = s.replace(Character.toString(c), getCharEncodingForACL(c)); } return s; }  static boolean hasSpecialCharacters(String value); static String getSolrSpecialCharacters(); static String getCharEncodingForACL(char c); static String encodeSpecialCharactersForACL(String s);  }### Answer:
@Test public void encodeSpecialCharactersForACL() { String termWithSpecialCharacters = "!@!@#asasdasd{}[])(*&^% asdasd asd asd asd asd"; String encoded = AcmSolrUtil.encodeSpecialCharactersForACL(termWithSpecialCharacters); assertFalse(AcmSolrUtil.hasSpecialCharacters(encoded)); assertEquals( "_0021_@_0021_@#asasdasd_007B__007D__005B__005D__0029__0028__002A__0026__005E_%_0020__0020_asdasd_0020_asd_0020_asd_0020_asd_0020_asd", encoded); }