use of com.b2international.collections.ints.IntSet in project snow-owl by b2ihealthcare.
the class NormalFormGroup method fillNumbers.
public void fillNumbers() {
final IntSet numbersUsed = PrimitiveSets.newIntOpenHashSetWithExpectedSize(unionGroups.size());
this.unionGroups.stream().filter(unionGroup -> unionGroup.getUnionGroupNumber() > 0).forEachOrdered(unionGroup -> numbersUsed.add(unionGroup.getUnionGroupNumber()));
int unionGroupNumber = 1;
for (final NormalFormUnionGroup unionGroup : unionGroups) {
if (unionGroup.getUnionGroupNumber() == NormalFormUnionGroup.UNKOWN_GROUP) {
while (numbersUsed.contains(unionGroupNumber)) {
unionGroupNumber++;
}
unionGroup.setUnionGroupNumber(unionGroupNumber);
unionGroupNumber++;
}
}
}
use of com.b2international.collections.ints.IntSet in project snow-owl by b2ihealthcare.
the class IntOpenHashSetTest method retainAll_empty_set.
@Test
public void retainAll_empty_set() {
IntSet intSet = PrimitiveSets.newIntOpenHashSet();
IntSet otherSet = PrimitiveSets.newIntOpenHashSet();
intSet.add(0);
intSet.add(5);
intSet.add(10);
intSet.retainAll(otherSet);
assertTrue("Integer set should be empty after retaining an empty set.", intSet.isEmpty());
}
use of com.b2international.collections.ints.IntSet in project snow-owl by b2ihealthcare.
the class IntOpenHashSetTest method equals_true.
@Test
public void equals_true() {
IntSet intSet = PrimitiveSets.newIntOpenHashSet();
IntSet otherSet = PrimitiveSets.newIntOpenHashSet();
intSet.add(0);
intSet.add(5);
intSet.add(10);
otherSet.add(0);
otherSet.add(5);
otherSet.add(10);
assertTrue("First set should be equal to second set.", intSet.equals(otherSet));
assertTrue("Second set should be equal to first set.", otherSet.equals(intSet));
}
use of com.b2international.collections.ints.IntSet in project snow-owl by b2ihealthcare.
the class IntOpenHashSetTest method create.
@Test
public void create() {
IntSet intSet = PrimitiveSets.newIntOpenHashSet();
assertTrue("Integer set should be empty.", intSet.isEmpty());
}
use of com.b2international.collections.ints.IntSet in project snow-owl by b2ihealthcare.
the class IntOpenHashSetTest method trimToSize.
@Test
public void trimToSize() {
IntSet intSet = PrimitiveSets.newIntOpenHashSet();
intSet.trimToSize();
}
Aggregations