JHFilter implements BufferedImageOp { @Override public Rectangle2D getBounds2D(BufferedImage src) { return new Rectangle(0, 0, src.getWidth(), src.getHeight()); }  @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_getBounds2D() { final TestFilter filter = new TestFilter(); final BufferedImage image = new BufferedImage(11, 22, BufferedImage.TYPE_BYTE_INDEXED); final Rectangle2D bounds = filter.getBounds2D(image); Assertions .assertThat(bounds.getWidth()) .isEqualTo(11); Assertions .assertThat(bounds.getHeight()) .isEqualTo(22); Assertions .assertThat(bounds.getX()) .isEqualTo(0); Assertions .assertThat(bounds.getY()) .isEqualTo(0); }