public void draw(List<? extends Pair<Integer, Integer>> coordinateList) {
    LOGGER.info("Start drawing next frame");
    LOGGER.info("Current buffer: " + current + " Next buffer: " + next);
    frameBuffers[next].clearAll();
    coordinateList.forEach(coordinate -> {
      var x = coordinate.getKey();
      var y = coordinate.getValue();
      frameBuffers[next].draw(x, y);
    });
    LOGGER.info("Swap current and next buffer");
    swap();
    LOGGER.info("Finish swapping");
    LOGGER.info("Current buffer: " + current + " Next buffer: " + next);
  }
@Test
  void testDraw() {
    try {
      var scene = new Scene();
      var field1 = Scene.class.getDeclaredField("current");
      var field2 = Scene.class.getDeclaredField("next");
      field1.setAccessible(true);
      field1.set(scene, 0);
      field2.setAccessible(true);
      field2.set(scene, 1);
      scene.draw(new ArrayList<>());
      assertEquals(1, field1.get(scene));
      assertEquals(0, field2.get(scene));
    } catch (NoSuchFieldException | IllegalAccessException e) {
      fail("Fail to access private field");
    }
  }