use of org.eclipse.collections.api.set.primitive.MutableByteSet in project eclipse-collections by eclipse.
the class AbstractByteSetTestCase method asSynchronized.
@Override
@Test
public void asSynchronized() {
super.asSynchronized();
MutableByteSet set = this.newWith((byte) 0, (byte) 1, (byte) 31, (byte) -1, (byte) -31, (byte) -24);
Verify.assertInstanceOf(SynchronizedByteSet.class, set.asSynchronized());
Assert.assertEquals(new SynchronizedByteSet(set), set.asSynchronized());
}
use of org.eclipse.collections.api.set.primitive.MutableByteSet in project eclipse-collections by eclipse.
the class AbstractByteSetTestCase method forEach.
@Override
@Test
public void forEach() {
super.forEach();
long[] sum = new long[1];
MutableByteSet set = this.newWith((byte) 0, (byte) 1, (byte) 31, (byte) 63, (byte) 65, (byte) 100, (byte) 127, (byte) 12, (byte) -76, (byte) -1, (byte) -54, (byte) -64, (byte) -63, (byte) -95, (byte) -128, (byte) -127);
set.forEach(each -> sum[0] += each);
Assert.assertEquals(-209L, sum[0]);
}
use of org.eclipse.collections.api.set.primitive.MutableByteSet in project eclipse-collections by eclipse.
the class AbstractByteSetTestCase method testHashCode.
@Override
@Test
public void testHashCode() {
super.testEquals();
MutableByteSet set1 = this.newWith((byte) 1, (byte) 31, (byte) 32);
MutableByteSet set2 = this.newWith((byte) 32, (byte) 31, (byte) 1);
Assert.assertEquals(set1.hashCode(), set2.hashCode());
}
use of org.eclipse.collections.api.set.primitive.MutableByteSet in project eclipse-collections by eclipse.
the class AbstractByteSetTestCase method clear.
@Override
@Test
public void clear() {
super.clear();
MutableByteSet set = this.newWith((byte) 0, (byte) 1, (byte) 31, (byte) -1, (byte) -128);
set.clear();
Verify.assertSize(0, set);
Assert.assertFalse(set.contains((byte) 0));
Assert.assertFalse(set.contains((byte) 31));
Assert.assertFalse(set.contains((byte) 1));
Assert.assertFalse(set.contains((byte) -1));
Assert.assertFalse(set.contains((byte) -128));
}
use of org.eclipse.collections.api.set.primitive.MutableByteSet in project eclipse-collections by eclipse.
the class AbstractByteSetTestCase method asLazy.
@Override
@Test
public void asLazy() {
super.asLazy();
MutableByteSet set = this.newWith((byte) 0, (byte) 1, (byte) 31, (byte) -1, (byte) -31, (byte) -24);
Assert.assertEquals(set.toSet(), set.asLazy().toSet());
Verify.assertInstanceOf(LazyByteIterable.class, set.asLazy());
}
Aggregations