### Question:
LogMessageUtil { public static String slf4jToStringFormatPlaceholders( String template ) { return SLF4J_PLACEHOLDER.matcher( template ).replaceAll( "%s" ); } private  LogMessageUtil(); static String slf4jToStringFormatPlaceholders( String template );  }### Answer:
@Test public void shouldThrowWhenStringIsNull() { try { slf4jToStringFormatPlaceholders( null ); fail( "Exception expected" ); } catch ( NullPointerException ignore ) { } }
@Test public void shouldDoNothingForEmptyString() { assertEquals( "", slf4jToStringFormatPlaceholders( "" ) ); }
@Test public void shouldDoNothingForStringWithoutPlaceholders() { assertEquals( "Simple log message", slf4jToStringFormatPlaceholders( "Simple log message" ) ); }
@Test public void shouldReplaceSlf4jPlaceholderWithStringFormatPlaceholder() { assertEquals( "Log message with %s single placeholder", slf4jToStringFormatPlaceholders( "Log message with {} single placeholder" ) ); assertEquals( "Log message %s with two %s placeholders", slf4jToStringFormatPlaceholders( "Log message {} with two {} placeholders" ) ); assertEquals( "Log %s message %s with three %s placeholders", slf4jToStringFormatPlaceholders( "Log {} message {} with three {} placeholders" ) ); }