Program: 63416
Project: 63416
Buggy source:
private List<Rectangle> getTableAreasFromCells(List<Rectangle> cells){
  List<List<Rectangle>> cellGroups=new ArrayList<List<Rectangle>>();
  for (  Rectangle cell : cells) {
    boolean addedToGroup=false;
    cellCheck:     for (    List<Rectangle> cellGroup : cellGroups) {
      for (      Rectangle groupCell : cellGroup) {
        Point2D[] groupCellCorners=groupCell.getPoints();
        Point2D[] candidateCorners=cell.getPoints();
        for (int i=0; i < candidateCorners.length; i++) {
          for (int j=0; j < groupCellCorners.length; j++) {
            if (candidateCorners[i].distance(groupCellCorners[j]) < 10) {
              cellGroup.add(cell);
              addedToGroup=true;
              break cellCheck;
            }
          }
        }
      }
    }
    if (!addedToGroup) {
      ArrayList<Rectangle> cellGroup=new ArrayList<Rectangle>();
      cellGroup.add(cell);
      cellGroups.add(cellGroup);
    }
  }
  List<Rectangle> tableAreas=new ArrayList<Rectangle>();
  for (  List<Rectangle> cellGroup : cellGroups) {
    float top=Float.MAX_VALUE;
    float left=Float.MAX_VALUE;
    float bottom=Float.MIN_VALUE;
    float right=Float.MIN_VALUE;
    for (    Rectangle cell : cellGroup) {
      if (cell.getTop() < top)       top=cell.getTop();
      if (cell.getLeft() < left)       left=cell.getLeft();
      if (cell.getBottom() > bottom)       bottom=cell.getBottom();
      if (cell.getRight() > right)       right=cell.getRight();
    }
    tableAreas.add(new Rectangle(top,left,right - left,bottom - top));
  }
  return tableAreas;
}

Fixed version (ground truth):
private List<Rectangle> getTableAreasFromCells(List<Rectangle> cells){
  List<List<Rectangle>> cellGroups=new ArrayList<List<Rectangle>>();
  for (  Rectangle cell : cells) {
    boolean addedToGroup=false;
    cellCheck:     for (    List<Rectangle> cellGroup : cellGroups) {
      for (      Rectangle groupCell : cellGroup) {
        Point2D[] groupCellCorners=groupCell.getPoints();
        Point2D[] candidateCorners=cell.getPoints();
        for (int i=0; i < candidateCorners.length; i++) {
          for (int j=0; j < groupCellCorners.length; j++) {
            if (candidateCorners[i].distance(groupCellCorners[j]) < 10) {
              cellGroup.add(cell);
              addedToGroup=true;
              break cellCheck;
            }
          }
        }
      }
    }
    if (!addedToGroup) {
      ArrayList<Rectangle> cellGroup=new ArrayList<Rectangle>();
      cellGroup.add(cell);
      cellGroups.add(cellGroup);
    }
  }
  List<Rectangle> tableAreas=new ArrayList<Rectangle>();
  for (  List<Rectangle> cellGroup : cellGroups) {
    if (cellGroup.size() < 4) {
      continue;
    }
    float top=Float.MAX_VALUE;
    float left=Float.MAX_VALUE;
    float bottom=Float.MIN_VALUE;
    float right=Float.MIN_VALUE;
    for (    Rectangle cell : cellGroup) {
      if (cell.getTop() < top)       top=cell.getTop();
      if (cell.getLeft() < left)       left=cell.getLeft();
      if (cell.getBottom() > bottom)       bottom=cell.getBottom();
      if (cell.getRight() > right)       right=cell.getRight();
    }
    tableAreas.add(new Rectangle(top,left,right - left,bottom - top));
  }
  return tableAreas;
}