### Question:
LaneManager { public static opencv_core.Mat histogram(opencv_core.Mat image) { if (image.channels() != 1) { throw new LaneManagerException("Histogram expects images with one channel only."); } int[] channels = new int[] {0}; IntPointer channelsPointer = new IntPointer(channels); int[] histSize = new int[] {HISTOGRAM_BINS}; IntPointer histSizePointer = new IntPointer(histSize); float[] ranges = new float[] {0, 256}; FloatPointer rangesPointer = new FloatPointer(ranges.length); rangesPointer.put(ranges, 0, ranges.length); opencv_core.Mat mask = new opencv_core.Mat(); opencv_core.Mat histogram = new opencv_core.Mat(); opencv_imgproc.calcHist(image, 1, channelsPointer, mask, histogram, 1 , histSizePointer, rangesPointer, true , false ); return histogram; }  static opencv_core.Mat readImage(String filename); static boolean writeImage(String filename, opencv_core.Mat img); static opencv_core.Mat doGrayscale(opencv_core.Mat src); static opencv_core.Mat doCanny(
      opencv_core.Mat image, double lowThreshold, double highThreshold); static opencv_core.Mat doGaussianBlur(opencv_core.Mat src, int kernelSize); static opencv_core.Mat doHoughLines(
      opencv_core.Mat image, double rho, double theta, int threshold,
      double minLineLength, double maxLineGap); static opencv_core.Mat applyMask(opencv_core.Mat image, int[] points); static opencv_core.Mat perspectiveTransform(
      opencv_core.Mat image, float[] fromPoints, float[] toPoints); static float[] getToPoints(int width, int height); static opencv_core.Mat imageToHsv(opencv_core.Mat image); static opencv_core.Mat getSaturationChannel(opencv_core.Mat image); static opencv_core.Mat getYuvChannel(opencv_core.Mat image); static opencv_core.Mat threshold(opencv_core.Mat image, double minValue); static opencv_core.Mat threshold(opencv_core.Mat image, double minValue, double maxValue); static opencv_core.Mat thresholdColor(opencv_core.Mat image); static opencv_core.Mat thresholdColor(opencv_core.Mat image, opencv_core.Scalar tapeColorMin, opencv_core.Scalar tapeColorMax); static int[] histogramArray(opencv_core.Mat image); static opencv_core.Mat histogram(opencv_core.Mat image); static HistogramPosition getMaxPosition(opencv_core.Mat histogram); static HistogramPosition getMaxPosition(int[] histogram); static HistogramPosition findLane(opencv_core.Mat src ); static void drawLine(
      opencv_core.Mat image, opencv_core.Point from, opencv_core.Point to,
      opencv_core.Scalar color, int thickness); static void drawFilledRectangle(
      opencv_core.Mat image, opencv_core.Point from, opencv_core.Point to,
      opencv_core.Scalar color); static opencv_core.Mat crop(opencv_core.Mat image, int x, int y, int width, int height); static final int HISTOGRAM_BINS; static final float[] SOURCE_POINTS; }### Answer:
@Test public void testHistogram() { opencv_core.Mat src = LaneManager.readImage(getResourcePath(TEST_IMAGE)); opencv_core.Mat saturationChannel = LaneManager.getSaturationChannel(src); opencv_core.Mat histogram = LaneManager.histogram(saturationChannel); assertTrue(LaneManager.writeImage("/tmp/robocar_histogram.jpg", histogram)); assertEquals(histogram.size().height(), 32); assertEquals(histogram.size().width(), 1); assertEquals(histogram.rows(), 32); assertEquals(histogram.cols(), 1); }