MAINT: Migration of nearest neighbour extraction to unit tests