void (@NotNull Graphics originGraphics, @NotNull Consumer<? super Graphics2D> drawingConsumer) { Graphics2D graphics = (Graphics2D)originGraphics.create(); try { drawingConsumer.consume(graphics); } finally { graphics.dispose(); } }