### Question:
TextureChooser extends JDialog { protected static int pixelBlend(int rgb1, double a1, int rgb2, double a2, int rgb3, double a3, int rgb4, double a4) { return 0xFF000000 | (int) (((rgb1 >>> 16) & 0xFF) * a1 + ((rgb2 >>> 16) & 0xFF) * a2 + ((rgb3 >>> 16) & 0xFF) * a3 + ((rgb4 >>> 16) & 0xFF) * a4 + 0.5) << 16 | (int) (((rgb1 >>> 8) & 0xFF) * a1 + ((rgb2 >>> 8) & 0xFF) * a2 + ((rgb3 >>> 8) & 0xFF) * a3 + ((rgb4 >>> 8) & 0xFF) * a4 + 0.5) << 8 | (int) (( rgb1 & 0xFF) * a1 + ( rgb2 & 0xFF) * a2 + ( rgb3 & 0xFF) * a3 + ( rgb4 & 0xFF) * a4 + 0.5); } TextureChooser(); int showDialog(); int showDialog(String texture); TexHexTriplet getTexture(); static final int CANCEL_OPTION; static final int APPROVE_OPTION; static final int ERROR_OPTION; }### Answer:
@Test public void testPixelBlend() throws Exception { int red = 0xffff0000; int green = 0xff00ff00; int expected = 0xff808000; int actual = TextureChooser.pixelBlend(red, 0.5, green, 0.5, 0, 0, 0, 0); assertEquals(expected, actual); }