Пример #1
0
 @Test
 public void equalsAndHashCode() {
   ImmutableBag<String> immutable = this.newBag();
   MutableBag<String> mutable = HashBag.newBag(immutable);
   Verify.assertEqualsAndHashCode(immutable, mutable);
   Assert.assertNotEquals(immutable, FastList.newList(mutable));
   Assert.assertEquals(this.newBag().toMapOfItemToCount().hashCode(), this.newBag().hashCode());
   Assert.assertNotEquals(immutable, mutable.with("5").without("1"));
 }