### Question:
StringUtils { public static int getOffsetAfterWhitespace(String text, int endOffset) { if (text == null || endOffset <= 0 || endOffset > text.length()) { return -1; } char c = text.charAt(endOffset - 1); int i = endOffset; if (!Character.isWhitespace(c)) { while (!Character.isWhitespace(c)) { i--; if (i <= 0) { break; } c = text.charAt(i - 1); } return i; } return -1; } private  StringUtils(); static boolean isEmpty(String value); static boolean isQuote(char c); static boolean isWhitespace(String value, int index); static boolean isWhitespace(String value, int index, int end); static boolean isWhitespace(String value); static boolean isBlank(String value); static void normalizeSpace(String str, StringBuilder b); static String normalizeSpace(String str); static String getStartWhitespaces(String lineText); static String getWhitespaces(String text, int start, int end); static void trimNewLines(String value, StringBuilder s); static String trimNewLines(String value); static String lTrim(String value); static int getNumberOfNewLines(String text, boolean isWhitespace, String delimiter, int newLineLimit); static String getDefaultString(String text); static int getOffsetAfterWhitespace(String text, int endOffset); static int getFrontWhitespaceLength(String text); static int getTrailingWhitespaceLength(String text); static String cleanPathForWindows(String pathString); static String escapeBackticks(String text); static boolean isTagOutsideOfBackticks(String text); static String getString(Object obj); static int findStartWord(String text, int offset, Predicate<Character> isValidChar); static int findEndWord(String text, int offset, Predicate<Character> isValidChar); static String convertToQuotelessValue(String value); static boolean isQuoted(String value); static final String[] EMPTY_STRING; static final String TRUE; static final String FALSE; static final Collection<String> TRUE_FALSE_ARRAY; }### Answer:
@Test public void testGetOffsetAfterWhitespace() { assertEquals(4, getOffsetAfterWhitespace("abc 123", 7)); assertEquals(4, getOffsetAfterWhitespace("abc 123", 6)); assertEquals(-1, getOffsetAfterWhitespace("abc 123", 4)); assertEquals(0, getOffsetAfterWhitespace("123", 3)); assertEquals(-1, getOffsetAfterWhitespace("123", 0)); }