JHFilter implements BufferedImageOp { @Override public Point2D getPoint2D(Point2D srcPt, Point2D dstPt) { if (dstPt == null) { dstPt = new Point2D.Double(); } dstPt.setLocation(srcPt.getX(), srcPt.getY()); return dstPt; }  @Override BufferedImage createCompatibleDestImage(BufferedImage src, ColorModel dstCM); @Override Rectangle2D getBounds2D(BufferedImage src); @Override Point2D getPoint2D(Point2D srcPt, Point2D dstPt); @Override RenderingHints getRenderingHints(); int[] getRGB(BufferedImage image, int x, int y, int width, int height, int[] pixels); void setRGB(BufferedImage image, int x, int y, int width, int height, int[] pixels);  }
@Test public void test_getPoint2DNull() { final TestFilter filter = new TestFilter(); final Point2D src = new Point(34, 56); final Point2D out = filter.getPoint2D(src, null); Assertions .assertThat(out.getX()) .isEqualTo(34); Assertions .assertThat(out.getY()) .isEqualTo(56); }
@Test public void test_getPoint2D() { final TestFilter filter = new TestFilter(); final Point2D src = new Point(34, 56); final Point2D dst = new Point(67, 78); final Point2D out = filter.getPoint2D(src, dst); Assertions .assertThat(out) .isSameAs(dst); Assertions .assertThat(out.getX()) .isEqualTo(34); Assertions .assertThat(out.getY()) .isEqualTo(56); }