use of org.eclipse.collections.api.set.primitive.MutableByteSet in project eclipse-collections by eclipse.
the class AbstractByteSetTestCase method count.
@Override
@Test
public void count() {
super.count();
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);
Assert.assertEquals(7L, set.count(BytePredicates.greaterThan((byte) 0)));
Assert.assertEquals(12L, set.count(BytePredicates.lessThan((byte) 32)));
Assert.assertEquals(4L, set.count(BytePredicates.greaterThan((byte) 32)));
Assert.assertEquals(1L, set.count(BytePredicates.greaterThan((byte) 100)));
Assert.assertEquals(14L, set.count(BytePredicates.lessThan((byte) 100)));
Assert.assertEquals(7L, set.count(BytePredicates.lessThan((byte) -50)));
Assert.assertEquals(6L, set.count(BytePredicates.lessThan((byte) -54)));
Assert.assertEquals(15L, set.count(BytePredicates.greaterThan((byte) -128)));
}
use of org.eclipse.collections.api.set.primitive.MutableByteSet in project eclipse-collections by eclipse.
the class AbstractByteSetTestCase method asUnmodifiable.
@Override
@Test
public void asUnmodifiable() {
super.asUnmodifiable();
MutableByteSet set = this.newWith((byte) 0, (byte) 1, (byte) 31, (byte) -1, (byte) -31, (byte) -24);
Verify.assertInstanceOf(UnmodifiableByteSet.class, set.asUnmodifiable());
Assert.assertEquals(new UnmodifiableByteSet(set), set.asUnmodifiable());
}
use of org.eclipse.collections.api.set.primitive.MutableByteSet in project eclipse-collections by eclipse.
the class AbstractByteSetTestCase method select.
@Override
@Test
public void select() {
super.select();
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);
Assert.assertEquals(this.newWith((byte) 63, (byte) 65, (byte) 100, (byte) 127), set.select(BytePredicates.greaterThan((byte) 32)));
Assert.assertEquals(this.newWith((byte) -76, (byte) -1, (byte) -54, (byte) -64, (byte) -63, (byte) -95, (byte) -128, (byte) -127), set.select(BytePredicates.lessThan((byte) 0)));
}
use of org.eclipse.collections.api.set.primitive.MutableByteSet in project eclipse-collections by eclipse.
the class AbstractByteSetTestCase method testEquals.
@Override
@Test
public void testEquals() {
super.testEquals();
MutableByteSet set1 = this.newWith((byte) 1, (byte) 31, (byte) 32);
MutableByteSet set2 = this.newWith((byte) 32, (byte) 31, (byte) 1);
MutableByteSet set3 = this.newWith((byte) 32, (byte) 32, (byte) 31, (byte) 1);
MutableByteSet set4 = this.newWith((byte) 32, (byte) 32, (byte) 31, (byte) 1, (byte) 1);
Verify.assertEqualsAndHashCode(set1, set2);
Verify.assertEqualsAndHashCode(set1, set3);
Verify.assertEqualsAndHashCode(set1, set4);
Verify.assertEqualsAndHashCode(set2, set3);
Verify.assertEqualsAndHashCode(set2, set4);
}
use of org.eclipse.collections.api.set.primitive.MutableByteSet in project eclipse-collections by eclipse.
the class ByteHashSetTest method reject.
@Override
@Test
public void reject() {
super.reject();
ByteHashSet set = ByteHashSet.newSetWith((byte) 0, (byte) 1, (byte) 31, (byte) -1, (byte) -2, (byte) -64, (byte) -128, (byte) 64);
MutableByteSet actualSet = set.reject(BytePredicates.greaterThan((byte) 0));
ByteHashSet expectedSet = ByteHashSet.newSetWith((byte) 0, (byte) -1, (byte) -2, (byte) -64, (byte) -128);
Assert.assertEquals(expectedSet, actualSet);
MutableByteSet actualSet2 = set.reject(BytePredicates.lessThan((byte) 0));
ByteHashSet expectedSet2 = ByteHashSet.newSetWith((byte) 0, (byte) 1, (byte) 31, (byte) 64);
Assert.assertEquals(expectedSet2, actualSet2);
}
Aggregations