void (Bookmark bookmark) { int line = ((LineBookmark)bookmark).getLine(); int anotherLine = line; if (line > 0) { anotherLine--; } else { anotherLine++; } CaretModel caretModel = getEditor().getCaretModel(); caretModel.moveToLogicalPosition(new LogicalPosition(anotherLine, 0)); bookmark.navigate(true); assertEquals(line, caretModel.getLogicalPosition().line); }