boolean isHeadless = Boolean.valueOf(System.getProperty("java.awt.headless", "false")).booleanValue();
if (!isHeadless || JVM.is15()) {
final BufferedImage image = new BufferedImage(3, 3, BufferedImage.TYPE_BYTE_BINARY);
final Graphics2D graphics = image.createGraphics();
graphics.setBackground(Color.WHITE);
graphics.clearRect(0, 0, 2, 2);
graphics.setColor(Color.BLACK);
graphics.drawLine(0, 0, 2, 2);
final ByteArrayOutputStream baosOriginal = new ByteArrayOutputStream();
ImageIO.write(image, "tiff", baosOriginal);