stronger test for correctness of getNeighbors