void () { initText("abc"); Inlay<?> i1 = addInlay(1, false); Inlay<?> i2 = addInlay(2, true); runWriteCommand(() -> { getEditor().getDocument().insertString(2, " "); getEditor().getDocument().insertString(1, " "); }); assertTrue(i1.isValid() && i1.getOffset() == 1); assertTrue(i2.isValid() && i2.getOffset() == 4); }