SvgTextUtil { public static String trimLeadingWhitespace(String toTrim) { if (toTrim == null) { return ""; } int current = 0; int end = toTrim.length(); while (current < end) { char currentChar = toTrim.charAt(current); if (Character.isWhitespace(currentChar) && !(currentChar == '\n' || currentChar == '\r')) { current++; } else { break; } } return toTrim.substring(current); } private  SvgTextUtil(); static String trimLeadingWhitespace(String toTrim); static String trimTrailingWhitespace(String toTrim); static void processWhiteSpace(TextSvgBranchRenderer root, boolean isLeadingElement); static boolean isOnlyWhiteSpace(String s); static float resolveFontSize(ISvgTextNodeRenderer renderer, float parentFontSize); static String filterReferenceValue(String name);  }
@Test public void trimLeadingTest() { String toTrim = "\t \t to trim \t"; String actual = SvgTextUtil.trimLeadingWhitespace(toTrim); String expected = "to trim \t"; Assert.assertEquals(expected, actual); }
@Test public void trimLeadingEmptyTest() { String toTrim = ""; String actual = SvgTextUtil.trimLeadingWhitespace(toTrim); String expected = ""; Assert.assertEquals(expected, actual); }
@Test public void trimLeadingNoLeadingTest() { String toTrim = "to Test "; String actual = SvgTextUtil.trimLeadingWhitespace(toTrim); String expected = "to Test "; Assert.assertEquals(expected, actual); }
@Test public void trimLeadingSingleWhiteSpaceTest() { String toTrim = " to Test "; String actual = SvgTextUtil.trimLeadingWhitespace(toTrim); String expected = "to Test "; Assert.assertEquals(expected, actual); }
@Test public void trimLeadingNonBreakingSpaceTest() { String toTrim = "\u00A0to Test "; String actual = SvgTextUtil.trimLeadingWhitespace(toTrim); String expected = "\u00A0to Test "; Assert.assertEquals(expected, actual); }
@Test public void trimLeadingOnlyWhitespaceTest() { String toTrim = "\t\t\t \t\t\t"; String actual = SvgTextUtil.trimLeadingWhitespace(toTrim); String expected = ""; Assert.assertEquals(expected, actual); }
@Test public void trimLeadingLineBreakTest() { String toTrim = " \n Test "; String actual = SvgTextUtil.trimLeadingWhitespace(toTrim); String expected = "\n Test "; Assert.assertEquals(expected, actual); }
@Test public void trimNullLeadingTest() { String expected = ""; String actual = SvgTextUtil.trimLeadingWhitespace(null); Assert.assertEquals(expected, actual); }