code: private boolean containsBlackPoint(int a, int b, int fixed, boolean horizontal) {
  
      if (horizontal) {
        for (int x = a; x <= b; x++) {
          if (image.get(x, fixed)) {
            return true;
          }
        }
      } else {
        for (int y = a; y <= b; y++) {
          if (image.get(fixed, y)) {
            return true;
          }
        }
      }
  
      return false;
    }
docs: Determines whether a segment contains a black point
  
  @param a          min value of the scanned coordinate
  @param b          max value of the scanned coordinate
  @param fixed      value of fixed coordinate
  @param horizontal set to true if scan must be horizontal, false if vertical
  @return true if a black point has been found, else false.