b.add(f); livePieces.add(b); branches.put(f, b); ((FlowSegment) myPiece).add(nextBlockStart); branches.put(nextBlockStart, myPiece); } else if (existingPiece == null && myPiece instanceof Fork) { // No merge, we had a fork. Start a segment preceding the fork FlowSegment newSegment = new FlowSegment(); newSegment.isLeaf = false; newSegment.add(nextBlockStart); newSegment.after = myPiece; pieceIterator.remove();