@Test public void addAllEmpty() { MutableList<Integer> integers = MultiReaderFastList.newList(); integers.addAll(Lists.fixedSize.of()); Verify.assertEmpty(integers); integers.addAll(Sets.fixedSize.of()); Verify.assertEmpty(integers); integers.addAll(FastList.newList()); Verify.assertEmpty(integers); integers.addAll(ArrayAdapter.newArray()); Verify.assertEmpty(integers); }
@Override @Test public void equalsAndHashCode() { MutableList<Integer> integers = this.newWith(1, 2, 3); MutableList<Integer> integers2 = this.newWith(1, 2, 3); MutableList<Integer> integers3 = this.newWith(1, null, 3, 4, 5); MutableList<Integer> integers4 = this.newWith(1, null, 3, 4, 5); MutableList<Integer> integers5 = this.newWith(1, null, 3); MutableList<Integer> randomAccessList = Lists.fixedSize.of(1, 2, 3); MutableList<Integer> randomAccessList2 = Lists.fixedSize.of(2, 3, 4); Verify.assertEqualsAndHashCode(integers, integers); Verify.assertPostSerializedEqualsAndHashCode(integers); Verify.assertEqualsAndHashCode(integers, integers2); Verify.assertEqualsAndHashCode(integers, randomAccessList); Assert.assertNotEquals(integers, integers3); Assert.assertNotEquals(integers, integers5); Assert.assertNotEquals(integers, randomAccessList2); Assert.assertNotEquals(integers, Sets.fixedSize.of()); Verify.assertEqualsAndHashCode(integers3, integers4); Verify.assertEqualsAndHashCode(integers3, ArrayAdapter.newArrayWith(1, null, 3, 4, 5)); Assert.assertEquals(integers, integers2); Assert.assertNotEquals(integers, integers3); }