Code example for TreeSet

Methods: add

0
        new PrimaryKeyImpl("pk_test", cols, table);
    } 
     
    @Test(expected = ModelException.class) 
    public void testCreateUniqueKeyWithSameColumnsAsPrimaryKey() throws ModelException { 
        SortedSet<CharSequence> cols = new TreeSet<CharSequence>();
        cols.add("test_id1");
        cols.add("test_id2");
        new PrimaryKeyImpl("pk_test", cols, table);
        new UniqueKeyImpl("uk_test", cols, table);
    } 
     
    @Test(expected = ModelException.class) 
    public void testCreatePrimaryKeyWithSameColumnsAsUniqueKey() throws ModelException { 
        SortedSet<CharSequence> cols = new TreeSet<CharSequence>();
        cols.add("test_id1");
        cols.add("test_id2");
        new UniqueKeyImpl("uk_test", cols, table);
        new PrimaryKeyImpl("pk_test", cols, table);
    }