### Question:
FrameBuffer implements Buffer { @Override public void clearAll() { Arrays.fill(pixels, Pixel.WHITE); } FrameBuffer(); @Override void clear(int x, int y); @Override void draw(int x, int y); @Override void clearAll(); @Override Pixel[] getPixels(); static final int WIDTH; static final int HEIGHT; }### Answer:
@Test public void testClearAll() { try { var field = FrameBuffer.class.getDeclaredField("pixels"); var pixels = new Pixel[FrameBuffer.HEIGHT * FrameBuffer.WIDTH]; Arrays.fill(pixels, Pixel.WHITE); pixels[0] = Pixel.BLACK; var frameBuffer = new FrameBuffer(); field.setAccessible(true); field.set(frameBuffer, pixels); frameBuffer.clearAll(); Assert.assertEquals(Pixel.WHITE, frameBuffer.getPixels()[0]); } catch (NoSuchFieldException | IllegalAccessException e) { Assert.fail("Fail to modify field access."); } }