### Question:
Scene { public Buffer getBuffer() { LOGGER.info("Get current buffer: " + current); return frameBuffers[current]; } Scene(); void draw(List<? extends Pair<Integer, Integer>> coordinateList); Buffer getBuffer();  }### Answer:
@Test public void testGetBuffer() { try { var scene = new Scene(); var field1 = Scene.class.getDeclaredField("current"); field1.setAccessible(true); field1.set(scene, 0); var frameBuffers = new FrameBuffer[2]; var frameBuffer = new FrameBuffer(); frameBuffer.draw(0, 0); frameBuffers[0] = frameBuffer; var field2 = Scene.class.getDeclaredField("frameBuffers"); field2.setAccessible(true); field2.set(scene, frameBuffers); Assert.assertEquals(frameBuffer, scene.getBuffer()); } catch (NoSuchFieldException | IllegalAccessException e) { Assert.fail("Fail to access private field."); } }