### Question:
SetDataType extends CollectionDataType { @Override public SetDataValue make() { return new SetDataValue(this); } SetDataType(DataType inner_type, AnyType any); static final String build_set_name(DataType inner); static SetDataType set_of(DataType inner, PrimitiveScope pscope); @Override SetDataValue make(); @Override boolean is_abstract();  }### Answer:
@Test public void add_wrong_types() throws Exception { try { m_set.add(m_scope.bool().make(true)); fail(); } catch (IllegalArgumentException e) { } try { m_set.add(m_vsuper); fail(); } catch (IllegalArgumentException e) { } }
@Test public void add_remove_check_invalid_parameters() throws Exception { try { m_set.add(null); fail(); } catch (IllegalArgumentException e) { } try { m_set.add(m_scope.bool().make(true)); fail(); } catch (IllegalArgumentException e) { } try { m_set.remove(null); fail(); } catch (IllegalArgumentException e) { } try { m_set.remove(m_scope.bool().make(true)); fail(); } catch (IllegalArgumentException e) { } try { m_set.contains(null); fail(); } catch (IllegalArgumentException e) { } try { m_set.contains(m_scope.bool().make(true)); fail(); } catch (IllegalArgumentException e) { } }
@Test public void set_comparison() throws Exception { SetDataValue v = m_set_type.make(); assertTrue(v.equals(m_set)); assertTrue(v.hashCode() == m_set.hashCode()); SetDataValue sup_v = new SetDataType(m_super_type, m_scope.any()).make(); assertFalse(sup_v.equals(m_set)); m_set.add(m_v1); assertFalse(v.equals(m_set)); assertFalse(v.hashCode() == m_set.hashCode()); m_set.add(m_v2); v.add(m_v2); assertFalse(v.equals(m_set)); assertFalse(v.hashCode() == m_set.hashCode()); v.add(m_v1); assertTrue(v.equals(m_set)); assertTrue(v.hashCode() == m_set.hashCode()); assertFalse(m_set.equals((Object) null)); assertFalse(m_set.equals(3)); assertTrue(m_set.equals(m_set)); }