@Test
public void testGetTilesToLoadLowerZoom() {

    int targetZ = 5;
    int z = 4;
    int x = 10;
    int y = 20;
    // Expect that we load all the tiles inside (z=4, x=10, y=20)
    // Which should be (in z=5):
    // - (x=20, y=40)
    // - (x=20, y=41)
    // - (x=21, y=40)
    // - (x=21, y=41)
    // Then adding the buffer we should get
    // 19<=x<=22
    // 39<=y<=42
    int minExpectedX = 19;
    int minExpectedY = 39;
    int expectedMatrixLen = 4;
    int expectedLen = expectedMatrixLen * expectedMatrixLen;
    List<TileCoord> tiles = GetWFSVectorTileHandler.getTilesToLoad(targetZ, z, x, y);
    for (TileCoord tile : tiles) {
        assertEquals(targetZ, tile.getZ());
    }
    assertEquals(expectedLen, tiles.size());
    Collections.sort(tiles, Comparator.comparing(TileCoord::getX).thenComparing(TileCoord::getY));
    int index = 0;
    for (int i = 0; i < expectedMatrixLen; i++) {
        int expectedX = minExpectedX + i;
        for (int j = 0; j < expectedMatrixLen; j++) {
            int expectedY = minExpectedY + j;
            TileCoord tile = tiles.get(index++);
            assertEquals(expectedX, tile.getX());
            assertEquals(expectedY, tile.getY());
        }
    }
}