### Question:
Strings { public static String leftPad(String str, int size) { return leftPad(str, size, " "); } private  Strings(); static boolean isNullOrEmpty(String str); static boolean hasText(String s); static boolean allHasText(String... strings); static boolean allNullOrEmpty(String... strings); static String leftTrim(String s); static String rightTrim(String str); static boolean containsNone(String str, String invalidCharsStr); static boolean containsOnly(String str, String allowedChars); static String repeat(char c, int count); static String repeat(String str, int count); static String reverse(String str); static String insertFromLeft(String str, int interval, String stringToInsert); static String insertFromRight(String str, int interval, String stringToInsert); static String rightPad(String str, int size); static String rightPad(String str, int size, char padChar); static String rightPad(String str, int size, String padStr); static String leftPad(String str, int size); static String leftPad(String str, int size, char padChar); static String subStringUntilFirst(String str, String s); static String subStringUntilLast(String str, String s); static String subStringAfterFirst(String str, String s); static String subStringAfterLast(String str, String s); static String leftPad(String str, int size, String padStr); static String whiteSpacesToSingleSpace(String str); static String eliminateWhiteSpaces(String str); static String[] separateGrams(String word, int gramSize); static final String EMPTY_STRING; static final String[] EMPTY_STRING_ARRAY; }### Answer:
@Test public void testLeftPad_StringInt() { assertEquals(null, leftPad(null, 5)); assertEquals(" ", leftPad("", 5)); assertEquals(" abc", leftPad("abc", 5)); assertEquals("abc", leftPad("abc", 2)); }
@Test public void testLeftPad_StringIntChar() { assertEquals(null, leftPad(null, 5, ' ')); assertEquals(" ", leftPad("", 5, ' ')); assertEquals(" abc", leftPad("abc", 5, ' ')); assertEquals("xxabc", leftPad("abc", 5, 'x')); assertEquals("\uffff\uffffabc", leftPad("abc", 5, '\uffff')); assertEquals("abc", leftPad("abc", 2, ' ')); String str = leftPad("aaa", 10000, 'a'); assertEquals(10000, str.length()); }
@Test public void testLeftPad_StringIntString() { assertEquals(null, leftPad(null, 5, "-+")); assertEquals(null, leftPad(null, 5, null)); assertEquals(" ", leftPad("", 5, " ")); assertEquals("-+-+abc", leftPad("abc", 7, "-+")); assertEquals("-+~abc", leftPad("abc", 6, "-+~")); assertEquals("-+abc", leftPad("abc", 5, "-+~")); assertEquals("abc", leftPad("abc", 2, " ")); assertEquals("abc", leftPad("abc", -1, " ")); assertEquals(" abc", leftPad("abc", 5, null)); assertEquals(" abc", leftPad("abc", 5, "")); }