Code example for TreeSet

Methods: add

0
        new UniqueKeyImpl("uk_test", cols, table);
    } 
     
    @Test(expected = ModelException.class) 
    public void testCreateUniqueKeyWithSameColumnsAsAnotherUniqueKey() throws ModelException { 
        SortedSet<CharSequence> cols = new TreeSet<CharSequence>();
        cols.add("test_uk1");
        cols.add("test_uk2");
        new UniqueKeyImpl("uk_test1", cols, table);
        new UniqueKeyImpl("uk_test2", cols, table);
    } 
     
    @Test(expected = ModelException.class) 
    public void testCreateUniqueKeyWithSameNameAsAnotherUniqueKey() throws ModelException { 
        SortedSet<CharSequence> cols1 = new TreeSet<CharSequence>();
        cols1.add("test_uk1");
        cols1.add("test_uk2");
        SortedSet<CharSequence> cols2 = new TreeSet<CharSequence>();
        cols2.add("test_data");
        new UniqueKeyImpl("uk_test", cols1, table);
        new UniqueKeyImpl("uk_test", cols2, table);