code: public static BufferedImage toBufferedImage(final Image image) {
          if (image instanceof BufferedImage) {
              return (BufferedImage) image;
          }
  
          // Create a buffered image with transparency
          final BufferedImage bufferedImage =
                  new BufferedImage(image.getWidth(null), image.getHeight(null), BufferedImage.TYPE_INT_ARGB);
  
          final Graphics2D bufferedGraphics = bufferedImage.createGraphics();
          bufferedGraphics.drawImage(image, 0, 0, null);
          bufferedGraphics.dispose();
  
          // Return the buffered image
          return bufferedImage;
      }
docs: Used to convert an image object to buffered image. Used in
  {@link ComponentDocumentationWrapper#getIconSrc(int)}
  
  @param image
  @return buffered image