### Question:
Distances { public static Iterable<Distance> distanceIterator(Distance upto) { return filter(distances, atMost(upto)); } private  Distances(); static Iterable<Distance> getDefaultDistances(); static Iterable<Distance> distanceIterator(Distance upto); static Distance abs(Distance distance); static Distance reverse(Distance distance);  }### Answer:
@Test public void test500m() { Distance upto = DefaultDistance.of(500, DistanceUnit.METERS); assertEquals(Lists.newArrayList(DefaultDistance.of(400, DistanceUnit.METERS)), Lists.newArrayList(Distances .distanceIterator(upto))); }
@Test public void test900m() { Distance upto = DefaultDistance.of(900, DistanceUnit.METERS); assertEquals(Lists.newArrayList( DefaultDistance.of(400, DistanceUnit.METERS), DefaultDistance.of(1D / 2, DistanceUnit.MILES)), Lists.newArrayList(Distances.distanceIterator(upto))); }
@Test public void test1000m() { Distance upto = DefaultDistance.of(1000, DistanceUnit.METERS); assertEquals(Lists.newArrayList( DefaultDistance.of(400, DistanceUnit.METERS), DefaultDistance.of(1D / 2, DistanceUnit.MILES), DefaultDistance.of(1, DistanceUnit.KILOMETERS)), Lists.newArrayList(Distances.distanceIterator(upto))); }
@Test public void test1100m() { Distance upto = DefaultDistance.of(1100, DistanceUnit.METERS); assertEquals(Lists.newArrayList( DefaultDistance.of(400, DistanceUnit.METERS), DefaultDistance.of(1D / 2, DistanceUnit.MILES), DefaultDistance.of(1, DistanceUnit.KILOMETERS)), Lists.newArrayList(Distances.distanceIterator(upto))); }