void (Editor editor, String text, int caretOffset, int selectionStart, int selectionEnd) { assertEquals("doc text", text, editor.getDocument().getText()); assertEquals("caret", caretOffset, editor.getCaretModel().getOffset()); SelectionModel selectionModel = editor.getSelectionModel(); assertEquals("selection precense", selectionStart != selectionEnd, selectionModel.hasSelection()); if (selectionModel.hasSelection()) { assertEquals("selection start", selectionStart, selectionModel.getSelectionStart()); assertEquals("selection end", selectionEnd, selectionModel.getSelectionEnd()); } }