### Question:
FrameBuffer implements Buffer { @Override public Pixel[] getPixels() { return pixels; } 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 testGetPixels() { 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); Assert.assertEquals(pixels, frameBuffer.getPixels()); } catch (NoSuchFieldException | IllegalAccessException e) { Assert.fail("Fail to modify field access."); } }