//Index by container id
ContainerIndex cntIdx = indexByContainer(blocks);
//For each container
for (int cntId : cntIdx.keySet())
{
//The blocks of this container
Container cnt = this.getContainer(cntId);
Block[] cntBlocks = cntIdx.get(cntId).toArray(new Block[cntIdx.get(cntId).size()]);