MappingUtils { public static String padValue(String input, int size, char pad, char justify) { switch (justify) { case 'l': return leftJust(input, size, pad); case 'L': return leftJust(input, size, pad); case 'r': return rightJust(input, size, pad); case 'R': return rightJust(input, size, pad); default: return input; } }  static String padValue(String input, int size, char pad, char justify); static String leftJust(String input, int size); static String leftJust(String input, int size, char pad); static String rightJust(String input, int size); static String rightJust(String input, int size, char pad); static String getSystemDate(); static String getSystemTime(); static String getSystemDateTime(); static String getMinValue(String one, String two); static String getMaxValue(String one, String two); static String getMinDate(String one, String two); static String getMaxDate(String one, String two);  }
@Test public void testPadValue() { assertEquals(" 1", MappingUtils.padValue("1", 3, ' ', 'R')); assertEquals(" 1", MappingUtils.padValue("1", 3, ' ', 'r')); assertEquals("1 ", MappingUtils.padValue("1", 3, ' ', 'l')); assertEquals("1 ", MappingUtils.padValue("1", 3, ' ', 'L')); assertEquals("1", MappingUtils.padValue("1", 3, ' ', 'B')); }