### Question:
CompletionUtils { static int getStringToParsePosition(String textTillCaret) { int lastIndexOfLineFeed = textTillCaret.lastIndexOf('\n'); String lineTillCaret; if (-1 == lastIndexOfLineFeed) { lineTillCaret = textTillCaret; } else { lineTillCaret = textTillCaret.substring(lastIndexOfLineFeed); } int pos = lastIndexOfLineFeed + 1; if (0 != lineTillCaret.length() && !Character.isWhitespace(lineTillCaret.charAt(lineTillCaret.length() - 1))) { int lastSeparatorIndex = getLastSeparatorIndex(lineTillCaret); if (-1 != lastSeparatorIndex) { pos += lastSeparatorIndex; } } return pos; }    }### Answer:
@Test public void testGetStringToParsePosition() { assertEquals(14, CompletionUtils.getStringToParsePosition(SELECT_ID_FROM_MYDB_TABLE)); assertEquals(38, CompletionUtils.getStringToParsePosition(SELECT_ID_FROM_TABLE_S_WHERE_S_ID_1)); }