int (final DimensionInfo info, final int startCell, final int cellCount) { int counter = 0; for (int cellIndex = startCell + cellCount - 2 /*gap after last cell should not be counted*/; cellIndex >= startCell; cellIndex--) { if (shouldAddGapAfterCell(info, cellIndex)) { counter++; } } return counter * info.getGap(); }