@Test
public void test_getBinIndex() {

    assertEquals((0) + 2, grid.getBinIndex(new Point(2, 0)));
    assertEquals((3) + 7, grid.getBinIndex(new Point(7, 1)));
    assertEquals((3 + 9) + 11, grid.getBinIndex(new Point(11, 2)));
    assertEquals((3 + 9 + 16) + 19, grid.getBinIndex(new Point(19, 3)));
    assertEquals((3 + 9 + 16 + 22) + 25, grid.getBinIndex(new Point(25, 4)));
    assertEquals((5940422 / 2 - 4320) + 632, grid.getBinIndex(new Point(632, 2160 / 2 - 1)));
    assertEquals((5940422 / 2) + 1743, grid.getBinIndex(new Point(1743, 2160 / 2)));
    assertEquals(5940422 - (3) + 1, grid.getBinIndex(new Point(1, 2160 - 1 - 0)));
    assertEquals(5940422 - (3 + 9) + 6, grid.getBinIndex(new Point(6, 2160 - 1 - 1)));
    assertEquals(5940422 - (3 + 9 + 16) + 15, grid.getBinIndex(new Point(15, 2160 - 1 - 2)));
    assertEquals(5940422 - (3 + 9 + 16 + 22) + 20, grid.getBinIndex(new Point(20, 2160 - 1 - 3)));
    // out of range
    assertEquals(-1, grid.getBinIndex(new Point(-1, -1)));
    assertEquals(-1, grid.getBinIndex(new Point(-1, 23)));
    assertEquals(-1, grid.getBinIndex(new Point(546, -1)));
    assertEquals(-1, grid.getBinIndex(new Point(4320 + 1, 46)));
    assertEquals(-1, grid.getBinIndex(new Point(343, 5940422 + 1)));
}