void (Icon icon, ScaleContext ctx) { Pair<BufferedImage, Graphics2D> pair = createImageAndGraphics(ctx.getScale(SYS_SCALE), icon.getIconWidth(), icon.getIconHeight()); BufferedImage iconImage = pair.first; Graphics2D g2d = pair.second; icon.paintIcon(null, g2d, 0, 0); if (shouldSaveGoldImage()) { saveImage(iconImage, getGoldImagePath(ctx)); } BufferedImage goldImage = loadImage(Path.of(getGoldImagePath(ctx))); ImageComparator.compareAndAssert( new ImageComparator.AASmootherComparator(0.1, 0.1, new Color(0, 0, 0, 0)), goldImage, iconImage, null); }