void (EditorEx editor, Random random) { List<Inlay<? extends MyInlayRenderer>> inlays = editor.getInlayModel().getInlineElementsInRange(0, editor.getDocument().getTextLength(), MyInlayRenderer.class); if (!inlays.isEmpty()) { Inlay<? extends MyInlayRenderer> inlay = inlays.get(random.nextInt(inlays.size())); inlay.getRenderer().width = MIN_INLAY_WIDTH + random.nextInt(MAX_INLAY_WIDTH - MIN_INLAY_WIDTH + 1); inlay.update(); } }