src/test/java/pityoulish/msgboard/SequencerMustHave.java
@Test public void bunch_of_IDs()
    throws Exception
  {
    final int enough = 152; // number of IDs to generate

    Sequencer         seq = newTestSubject();
    List<String>     list = new ArrayList<>(enough);
    SortedSet<String> set = new TreeSet<>(seq.getComparator());

    for (int i=0; i<enough; i++)
     {
       String msgid = _createCheckedMessageID(seq);
       list.add(msgid);
       assertTrue("duplicate "+msgid, set.add(msgid));
     }

    List<String> sorted = new ArrayList<>(set);
    assertEquals("wrong sort order", list, sorted);
  }
/**
   * Generates a bunch of IDs and performs comparative tests on them.
   * <ul>
   * <li>no duplicates</li>
   * <li>sort in order of generation</li>
   * </ul>
   */
Generates a bunch of IDs and performs comparative tests on them.

no duplicates
sort in order of generation

Generates a bunch of IDs and performs comparative tests on them . no duplicates sort in order of generation
@Test public void bunch_of_IDs()
    throws Exception
  {
    final int enough = 152; 
    Sequencer         seq = newTestSubject();
    List<String>     list = new ArrayList<>(enough);
    SortedSet<String> set = new TreeSet<>(seq.getComparator());
    for (int i=0; i<enough; i++)
     {
       String msgid = _createCheckedMessageID(seq);
       list.add(msgid);
       assertTrue("duplicate "+msgid, set.add(msgid));
     }
    List<String> sorted = new ArrayList<>(set);
    assertEquals("wrong sort order", list, sorted);
  }
@ Test public void bunch_of_IDs ( ) throws Exception { final int enough = 152 ; Sequencer seq = newTestSubject ( ) ; List < String > list = new ArrayList < > ( enough ) ; SortedSet < String > set = new TreeSet < > ( seq . getComparator ( ) ) ; for ( int i = 0 ; i < enough ; i ++ ) { String msgid = _createCheckedMessageID ( seq ) ; list . add ( msgid ) ; assertTrue ( "duplicate " + msgid , set . add ( msgid ) ) ; } List < String > sorted = new ArrayList < > ( set ) ; assertEquals ( "wrong sort order" , list , sorted ) ; }
Generates a bunch of IDs and performs comparative tests on them.
Generates a bunch of IDs and performs comparative tests on them .
// number of IDs to generate