leftMinimumFirstNightIndex = lastNightIndex;
} else {
otherBed = leftBed;
rightMinimumFirstNightIndex = lastNightIndex;
}
moveListByPillarPartDuo.add(new BedChangeMove(pillarPartBedDesignation, otherBed));
// For every BedDesignation in that pillar part duo
while (lowestIt.hasNextWithMaximumFirstNightIndexes(
leftMinimumFirstNightIndex, rightMinimumFirstNightIndex)) {
pillarPartBedDesignation = lowestIt.next();
lastNightIndex = pillarPartBedDesignation.getAdmissionPart().getLastNight().getIndex();
if (lowestIt.isLastNextWasLeft()) {
otherBed = rightBed;
leftMinimumFirstNightIndex = Math.max(leftMinimumFirstNightIndex, lastNightIndex);
} else {
otherBed = leftBed;
rightMinimumFirstNightIndex = Math.max(rightMinimumFirstNightIndex, lastNightIndex);
}
moveListByPillarPartDuo.add(new BedChangeMove(pillarPartBedDesignation, otherBed));
}
moveList.add(new CompositeMove(moveListByPillarPartDuo));
}
}
}