@NotNull @Override public BufferedImage applyFilter(@NotNull BufferedImage bufferedImage) { Graphics2D graphics2D = bufferedImage.createGraphics(); graphics2D.setColor(color.getBackground()); graphics2D.setStroke(new BasicStroke(lineThickness.thickness())); Point leftRectangleBottom = new Point(rectangle1.x + rectangle1.width, rectangle1.y + rectangle1.height); Point leftRectangleTop = new Point(rectangle1.x + rectangle1.width, rectangle1.y); Point rightRectangleTop = new Point(rectangle2.x + xOffset, rectangle2.y + insets.top); Point rightRectangleBottom = new Point(rectangle2.x + xOffset, rectangle2.y + insets.top + rectangle2.height); PointDistance pointDistance = calculatePoints(leftRectangleTop, leftRectangleBottom, rightRectangleTop, rightRectangleBottom); graphics2D.drawLine(pointDistance.getLeftPoint().x, pointDistance.getLeftPoint().y, pointDistance.getRightPoint().x, pointDistance.getRightPoint().y); graphics2D.dispose(); return bufferedImage; }