@SuppressWarnings({"ForLoopReplaceableByForEach"})
public void testContainsAll() throws Exception {
int[] ints = {1138, 42, 13, 86, 99};
TIntSet set = new TIntHashSet();
set.addAll(ints);
TIntSet other = new TIntHashSet();
other.addAll(ints);
List<Number> ints_list = new ArrayList<Number>();
for (int element : ints) {
ints_list.add(element);
}
for (int index = 0; index < ints.length; index++) {
assertTrue(Integer.valueOf(ints[index]).toString(),
set.contains(ints[index]));
}
assertTrue("containsAll(Collection<?>) failed: " + set,
set.containsAll(ints_list));
ints_list.remove(Integer.valueOf(42));
ints_list.add(Long.valueOf(42));
assertFalse("containsAll(Collection<?>) failed: " + set,
set.containsAll(ints_list));
assertTrue("containsAll(TIntSet) failed (same set): " + set,
set.containsAll(set));
assertTrue("containsAll(TIntSet) failed (other set): " + set,
set.containsAll(other));
assertTrue("containsAll(int[]) failed: " + set,
set.containsAll(ints));
int[] failed = {42, 86, 99, 123456};
TIntSet failed_set = new TIntHashSet();
failed_set.addAll(failed);
List<Integer> failed_list = new ArrayList<Integer>();
for (int element : failed) {
failed_list.add(element);
}