private static LeafBlockWrapper getRightMostBlock(Collection<? extends LeafBlockWrapper> toRealign) {
    int maxSpacesBeforeBlock = -1;
    LeafBlockWrapper rightMostBlock = null;

    for (LeafBlockWrapper block : toRealign) {
      int spaces = block.getNumberOfSymbolsBeforeBlock().getTotalSpaces();
      if (spaces > maxSpacesBeforeBlock) {
        maxSpacesBeforeBlock = spaces;
        rightMostBlock = block;
      }
    }

    return rightMostBlock;
  }
private static LeafBlockWrapper getRightMostBlock(Collection<? extends LeafBlockWrapper> toRealign)