The problem is that it is difficult to determine distances to objects at large redshift (distances).
This test was initially performed by Loh and Spillar. What they did was to look in different directions on the sky and count the number of galaxies in various redshift bins. For example, one could count the number of galaxies between z = 0.5 and 0.6, z = 0.6 and 0.7, z = 0.7 and 0.8, z = 0.8 and 0.9, and so on. Since, the redshift z indicates distances in the Universe what they were doing was measuring the number of galaxies in various shells (volumes) of the Universe. The manner in which the density of galaxies changed at large z would then indicate how the shape of the Universe was changing at large z.
The density of galaxies falls off strongly at large z (even for the flat model) because, Loh and Spillar did not plot their data directly, they plotted observed number density / proper density. The proper density takes account of the expansion of the number and thus increases as z increases (the Universe is smaller ---> density of galaxies is larger).