### Question:
StringUtil { public static String justifyLeft( String str, final int width, char padWithChar ) { return justifyLeft(str, width, padWithChar, true); } private  StringUtil(); static String combineLines( String[] lines ); static String combineLines( String[] lines,
                                       char separator ); static List<String> splitLines( final String content ); static String createString( String pattern,
                                       Object... parameters ); static String createString( final char charToRepeat,
                                       int numberOfRepeats ); static String setLength( String original,
                                    int length,
                                    char padChar ); static String justifyRight( String str,
                                       final int width,
                                       char padWithChar ); static String justifyLeft( String str,
                                      final int width,
                                      char padWithChar ); static String justifyCenter( String str,
                                        final int width,
                                        char padWithChar ); static String truncate( Object obj,
                                   int maxLength ); static String truncate( Object obj,
                                   int maxLength,
                                   String suffix ); static String read( Reader reader ); static String read( InputStream stream ); static void write( String content,
                              OutputStream stream ); static void write( String content,
                              Writer writer ); static String getStackTrace( Throwable throwable ); static String normalize( String text ); static String getHexString( byte[] bytes ); static byte[] fromHexString( String hexadecimal ); static final String[] EMPTY_STRING_ARRAY; }### Answer:
@Test public void justifyLeftShouldTruncateStringsThatAreTooLong() { assertEquals("This is the st", StringUtil.justifyLeft("This is the string", 14, ' ')); }
@Test public void justifyLeftShouldAppendCharacterForStringsThatAreTooShort() { assertEquals("This ", StringUtil.justifyLeft("This", 10, ' ')); }
@Test public void justifyLeftShouldRemoveLeadingWhitespace() { assertEquals("This ", StringUtil.justifyLeft(" This", 10, ' ')); assertEquals("This ", StringUtil.justifyLeft("\tThis", 10, ' ')); }
@Test public void justifyLeftShouldAppendCharacterForEmptyStrings() { assertEquals(" ", StringUtil.justifyLeft("", 10, ' ')); }
@Test public void justifyLeftShouldAppendCharacterForNullStrings() { assertEquals(" ", StringUtil.justifyLeft(null, 10, ' ')); }
@Test public void justifyLeftShouldReturnStringsThatAreTheDesiredLength() { assertEquals("This is the string", StringUtil.justifyLeft("This is the string", 18, ' ')); }