void () { initText("looooooooooooooooong wooooooooooooooooords"); configureSoftWraps(10); end(); VisualPosition caretPosition = getEditor().getCaretModel().getCurrentCaret().getVisualPosition(); Point caretPoint = getEditor().visualPositionToXY(caretPosition); Rectangle visibleArea = getEditor().getScrollingModel().getVisibleArea(); assertTrue(visibleArea.contains(caretPoint)); }