private Image produceAndCacheImage( Dimension size ) {
			return cache.computeIfAbsent( size, size2 -> {
				// using ImageIcon here makes sure that the image is loaded
				return new ImageIcon( producer.apply( size2 ) ).getImage();
			} );
		}
A multi-resolution image implementation that produces images on demand for requested sizes.
flatlaf-core/src/main/java9/com/formdev/flatlaf/util/MultiResolutionImageSupport.java