StringUtil { public static int findWhitespace(CharSequence s) { return findWhitespace(s, 0); } private  StringUtil(); static String fixSizeString(int size, boolean alignLeft,
			char filler, long value); static String fixSizeString(int size, boolean alignLeft,
			String s); static String fixSizeString(int size, boolean alignLeft,
			char filler, String s); static List<Line> splitLines(String s); static int findStartTrimWhitespace(CharSequence s); static int findStartTrimWhitespace(CharSequence s, int start); static int findEndTrimWhitespace(CharSequence s); static int findStartTrimNewlineChars(CharSequence s); static int findStartTrimNewlineChars(CharSequence s, int start); static int findEndTrimNewlineChars(CharSequence s); static int findWhitespace(CharSequence s); static int findWhitespace(CharSequence s, int start); static boolean containsIgnoreCase(String source, String target); static boolean startsWithIgnoreCase(String s, String prefix); static int indexOfIgnoreCase(String source, String target); static boolean equalsIgnoreCase(char ch1, char ch2);  }
@Test public void findWhitespace() { final String s = "Bla\n\r\n\r \thello \r\r\n\nblabla"; Assert.assertEquals(3, StringUtil.findWhitespace(s)); for (int i = 0; i < s.length(); i++) { final int expected = i <= 3 ? 3 : i < 9 ? i : i < 14 ? 14 : i < s.length() - 6 ? i : s.length(); Assert.assertEquals(expected, StringUtil.findWhitespace(s, i)); } }