Program: 171207
Project: 171207
Buggy source:
private Map<Integer,List<Point>> splitIntoBands(final List<Point> POINTS,final double BAND_WIDTH){
  Map<Integer,List<Point>> mapOfBands=new HashMap<>(getNoOfBands());
  if (POINTS.isEmpty()) {
    return mapOfBands;
  }
  int noOfPoints=POINTS.size();
  double currentBandMinY;
  double currentBandMaxY;
  double currentBandMinYScaled;
  double currentBandMaxYScaled;
  Point firstPoint=new Point(POINTS.get(0).getX(),POINTS.get(0).getY());
  for (int band=0; band < getNoOfBands(); band++) {
    List<Point> listOfPointsInBand=new ArrayList<>(noOfPoints);
    listOfPointsInBand.add(firstPoint);
    mapOfBands.put(band,listOfPointsInBand);
  }
  for (int i=1; i < noOfPoints - 1; i++) {
    Point last=POINTS.get(i - 1);
    double lastY=height - (last.getY() * scaleY);
    Point current=POINTS.get(i);
    double currentY=height - (current.getY() * scaleY);
    Point next=POINTS.get(i + 1);
    double nextY=height - (next.getY() * scaleY);
    for (int band=0; band < getNoOfBands(); band++) {
      currentBandMinY=band * BAND_WIDTH;
      currentBandMaxY=currentBandMinY + BAND_WIDTH;
      currentBandMinYScaled=height - currentBandMinY * scaleY;
      currentBandMaxYScaled=height - currentBandMaxY * scaleY;
      if (Double.compare(lastY,currentBandMinYScaled) >= 0) {
        mapOfBands.get(band).add(Helper.calcIntersectionPoint(last,current,currentBandMinY));
      }
 else       if (Double.compare(currentY,currentBandMinYScaled) <= 0 && Double.compare(currentY,currentBandMaxYScaled) >= 0) {
        mapOfBands.get(band).add(new Point(current.getX(),current.getY()));
      }
 else       if (Double.compare(nextY,currentBandMaxYScaled) <= 0) {
        mapOfBands.get(band).add(Helper.calcIntersectionPoint(current,next,currentBandMaxY));
      }
    }
  }
  Point lastPoint=new Point(POINTS.get(noOfPoints - 1).getX(),clamp(0,BAND_WIDTH,POINTS.get(noOfPoints - 1).getY()));
  for (int band=0; band < getNoOfBands(); band++) {
    mapOfBands.get(band).add(lastPoint);
  }
  return mapOfBands;
}

Fixed version (ground truth):
private Map<Integer,List<Point>> splitIntoBands(final List<Point> POINTS,final double BAND_WIDTH){
  Map<Integer,List<Point>> mapOfBands=new HashMap<>(getNoOfBands());
  if (POINTS.isEmpty()) {
    return mapOfBands;
  }
  int noOfPoints=POINTS.size();
  double currentBandMinY;
  double currentBandMaxY;
  double currentBandMinYScaled;
  double currentBandMaxYScaled;
  Point firstPoint=new Point(POINTS.get(0).getX(),POINTS.get(0).getY());
  for (int band=0; band < getNoOfBands(); band++) {
    List<Point> listOfPointsInBand=new ArrayList<>(noOfPoints);
    listOfPointsInBand.add(firstPoint);
    mapOfBands.put(band,listOfPointsInBand);
  }
  for (int i=1; i < noOfPoints - 1; i++) {
    Point last=POINTS.get(i - 1);
    double lastY=height - (last.getY() * scaleY);
    Point current=POINTS.get(i);
    double currentY=height - (current.getY() * scaleY);
    Point next=POINTS.get(i + 1);
    double nextY=height - (next.getY() * scaleY);
    for (int band=0; band < getNoOfBands(); band++) {
      currentBandMinY=band * BAND_WIDTH;
      currentBandMaxY=currentBandMinY + BAND_WIDTH;
      currentBandMinYScaled=height - currentBandMinY * scaleY;
      currentBandMaxYScaled=height - currentBandMaxY * scaleY;
      if (Double.compare(lastY,currentBandMinYScaled) >= 0) {
        mapOfBands.get(band).add(Helper.calcIntersectionPoint(last,current,currentBandMinY));
      }
 else       if (Double.compare(currentY,currentBandMinYScaled) <= 0 && Double.compare(currentY,currentBandMaxYScaled) >= 0) {
        mapOfBands.get(band).add(new Point(current.getX(),current.getY()));
      }
 else       if (Double.compare(nextY,currentBandMaxYScaled) <= 0) {
        mapOfBands.get(band).add(Helper.calcIntersectionPoint(current,next,currentBandMaxY));
      }
    }
  }
  Point lastPoint=new Point(POINTS.get(noOfPoints - 1).getX(),clamp(0,BAND_WIDTH,POINTS.get(noOfPoints - 1).getY()));
  mapOfBands.forEach((band,pointsInBand) -> {
    Point lastPointInBand=pointsInBand.get(pointsInBand.size() - 1);
    if (noOfPoints - lastPointInBand.getX() > 2) {
      pointsInBand.add(new Point(noOfPoints - 1,lastPointInBand.getY()));
    }
    pointsInBand.add(lastPoint);
  }
);
  return mapOfBands;
}