Consider the following Java method
private void removePointsOutOfBounds() { List<Point> pointsToRemove = new ArrayList<Point>(); for (Point point : this.points) { if (point.getY() < 0) { pointsToRemove.add(point); } } this.points.removeAll(pointsToRemove); }