Add test for newNeighborsOnly.
Implement newNeighborsOnly.