### Question:
SqlLikeEscaper { public static String escapeControlCharacters(@Nullable String toEscape) { if(toEscape == null || toEscape.isEmpty()){ return toEscape; } for (String controlSymbol : CONTROL_SYMBOLS) { toEscape = toEscape.replace(controlSymbol, "\\" + controlSymbol); } return toEscape; } private  SqlLikeEscaper(); static String escapeControlCharacters(@Nullable String toEscape);  }### Answer:
@Test public void shouldEscapePercent() throws Exception { assertEquals("\\%", SqlLikeEscaper.escapeControlCharacters("%")); }
@Test public void shouldEscapeUnderscore() throws Exception { assertEquals("\\_", SqlLikeEscaper.escapeControlCharacters("_")); }
@Test public void shouldEscapeExclamation() throws Exception { assertEquals("\\!", SqlLikeEscaper.escapeControlCharacters("!")); }
@Test public void shouldEscapeRoof() { assertEquals("\\^", SqlLikeEscaper.escapeControlCharacters("^")); }
@Test public void shouldEscapeLeftBrace() throws Exception { assertEquals("\\[", SqlLikeEscaper.escapeControlCharacters("[")); }
@Test public void shouldEscapeRightBrace() throws Exception { assertEquals("\\]", SqlLikeEscaper.escapeControlCharacters("]")); }
@Test public void shouldNotEscapeEmptyString(){ assertEquals("", SqlLikeEscaper.escapeControlCharacters("")); }
@Test public void shouldDoNothingOnNull() throws Exception { assertNull(SqlLikeEscaper.escapeControlCharacters(null)); }
@Test public void shouldNotEscapeAnything() throws Exception { assertEquals("abc", SqlLikeEscaper.escapeControlCharacters("abc")); }
@Test public void shouldEscapeControlCharactersWhileTextIsInside() throws Exception { assertEquals("\\^\\%\\!\\_\\[\\]abc\\^\\%\\!\\_\\[\\]", SqlLikeEscaper.escapeControlCharacters("^%!_[]abc^%!_[]")); }
@Test public void shouldEscapeControlCharactersInsideText() throws Exception { assertEquals("abc\\^\\%\\!\\_\\[\\]abc", SqlLikeEscaper.escapeControlCharacters("abc^%!_[]abc")); }