### Question:
Ordinal implements Comparable<Ordinal> { public static Stream<Ordinal> natural() { return Stream.iterate(first(), Ordinal::next); } private  Ordinal(int num); static Ordinal first(); static Stream<Ordinal> natural(); static Ordinal of(int oneBased); static Ordinal fromIndex(int zeroBased); int toIndex(); Ordinal next(); @Override int compareTo(Ordinal that); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }### Answer:
@Test public void testComparable() { List<Ordinal> ordinals = Ordinal.natural().limit(100).collect(Collectors.toCollection(ArrayList::new)); Collections.shuffle(ordinals); Collections.sort(ordinals); assertThat(ordinals).isStrictlyOrdered(); assertThat(ordinals.stream().map(Ordinal::toString).limit(7)) .containsExactly("1st", "2nd", "3rd", "4th", "5th", "6th", "7th") .inOrder(); }
@Test public void testNatural() { assertThat(Ordinal.natural().limit(5).map(Ordinal::toString)) .containsExactly("1st", "2nd", "3rd", "4th", "5th") .inOrder(); }