### Question:
BagDataType extends CollectionDataType { @Override public BagDataValue make() { return new BagDataValue(this); } BagDataType(DataType inner_type, AnyType any); static final String build_bag_name(DataType inner); static BagDataType bag_of(DataType inner, PrimitiveScope pscope); @Override BagDataValue make(); @Override boolean is_abstract();  }### Answer:
@Test(expected = IllegalArgumentException.class) public void add_wrong_types() throws Exception { assertTrue(m_bag.add(m_scope.bool().make(true))); }
@Test(expected = IllegalArgumentException.class) public void remove_wrong_type_fails() throws Exception { m_bag.remove(m_scope.bool().make(true)); }
@Test(expected = IllegalArgumentException.class) public void contains_wrong_type_fails() throws Exception { m_bag.contains(m_scope.bool().make(true)); }
@Test(expected = IllegalArgumentException.class) public void count_wrong_type_fails() throws Exception { m_bag.count(m_scope.bool().make(true)); }
@Test public void bag_comparison() throws Exception { BagDataValue v = m_bag_type.make(); assertTrue(v.equals(m_bag)); assertTrue(v.hashCode() == m_bag.hashCode()); BagDataValue sup_v = new BagDataType(m_super_type, m_scope.any()).make(); assertFalse(sup_v.equals(m_bag)); assertTrue(m_bag.add(m_v1)); assertFalse(v.equals(m_bag)); assertFalse(v.hashCode() == m_bag.hashCode()); assertTrue(m_bag.add(m_v2)); v.add(m_v2); assertFalse(v.equals(m_bag)); assertFalse(v.hashCode() == m_bag.hashCode()); assertTrue(v.add(m_v1)); assertTrue(v.equals(m_bag)); assertTrue(v.hashCode() == m_bag.hashCode()); assertTrue(v.add(m_v1)); assertFalse(v.equals(m_bag)); assertFalse(v.hashCode() == m_bag.hashCode()); assertTrue(m_bag.add(m_v1)); assertTrue(v.equals(m_bag)); assertTrue(v.hashCode() == m_bag.hashCode()); assertFalse(m_bag.equals((Object) null)); assertFalse(m_bag.equals(3)); assertTrue(m_bag.equals(m_bag)); }