}
private Segments removeLine(Segments newSegments, int y) {
Segments results = newSegments;
for (int x = 0; x < width; x++) {
results = results.remove(new Segment(x, y));
}
for (int j = y - 1; j >= 0; j--) {
for (int x = 0; x < width; x++) {
if (newSegments.contains(new Segment(x, j))) {
results = results.replace(new Segment(x, j), new Segment(x, j + 1));
}
}
}
return results;