WhitespaceTrimmer { static String ltrim(String text) { if (text == null) { return ""; } Matcher mStart = whiteStart.matcher(text); return mStart.find() ? text.substring(mStart.end()) : text; } private  WhitespaceTrimmer(); static String trim(String text);  }
@Test public void testLTrim() throws IOException { assertEquals("noTrim", WhitespaceTrimmer.ltrim("noTrim")); assertEquals("noEmbedded Trim", WhitespaceTrimmer.ltrim("noEmbedded Trim")); assertEquals("leftTrim", WhitespaceTrimmer.ltrim(" leftTrim")); assertEquals("leftTrim", WhitespaceTrimmer.ltrim("\nleftTrim")); assertEquals("leftTrim", WhitespaceTrimmer.ltrim("\tleftTrim")); assertEquals("noRightTrim ", WhitespaceTrimmer.ltrim("noRightTrim ")); assertEquals("leftTrimNoRightTrim ", WhitespaceTrimmer.ltrim(" leftTrimNoRightTrim ")); }