void (@NotNull RadContainer grid, final boolean isRow, final int cellIndex) { if (!grid.getLayoutManager().isGrid()){ throw new IllegalArgumentException("container must be grid"); } final int cellCount = isRow ? grid.getGridRowCount() : grid.getGridColumnCount(); if (cellIndex == 0 && cellCount == 0) return; if (cellIndex < 0 || cellIndex >= cellCount) { throw new IllegalArgumentException("invalid index: " + cellIndex); } }