boolean (@NotNull LeafBlockWrapper offsetResponsibleBlock, @NotNull LeafBlockWrapper currentBlock) { OffsetPair pair = new OffsetPair(offsetResponsibleBlock.getStartOffset(), currentBlock.getStartOffset()); int count = myRealignmentCounts.containsKey(pair) ? myRealignmentCounts.get(pair) + 1 : 0; if (count > myTotalAlignmentsCount) { return false; } myRealignmentCounts.put(pair, count); return true; }