@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)); }
@Override public BagDataValue make() { return new BagDataValue(this); }
BagDataType extends CollectionDataType { @Override public BagDataValue make() { return new BagDataValue(this); } }
BagDataType extends CollectionDataType { @Override public BagDataValue make() { return new BagDataValue(this); } BagDataType(DataType inner_type, AnyType any); }
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(); }
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();  }