void (final EditorEx editor, Random random) { if (editor.getDocument().isInBulkUpdate()) return; List<CustomFoldRegion> customRegions = ContainerUtil.findAll(editor.getFoldingModel().getAllFoldRegions(), CustomFoldRegion.class); int count = customRegions.size(); if (count > 0) { CustomFoldRegion region = customRegions.get(random.nextInt(count)); region.putUserData(REGION_WIDTH, random.nextInt(MAX_CUSTOM_FOLD_REGION_WIDTH)); region.update(); } }