throw new AssertionFailedError("must not fetch all data");
}
};
RowKeySetImpl set1 = _createKeySet(true);
set1.setCollectionModel(ModelUtils.toCollectionModel(infinite));
set1.remove(k3);
RowKeySetImpl set2 = _createKeySet(false);
set2.addAll(set1);
assertTrue(set2.contains(k1));
assertTrue(set2.contains(k2));
assertFalse(set2.contains(k3));
// now test removeAll:
set2.add(k3);
set2.removeAll(set1);
assertFalse(set2.contains(k1));
assertFalse(set2.contains(k2));
assertTrue(set2.contains(k3));
assertEquals("size", 1, set2.size());
// now test with both sets being infinite:
set1 = _createKeySet(true);
set1.setCollectionModel(ModelUtils.toCollectionModel(infinite));
set1.remove(k1);
set1.remove(k2);
set2 = _createKeySet(true);
set2.setCollectionModel(ModelUtils.toCollectionModel(infinite));
set2.remove(k2);
set2.remove(k3);
RowKeySetImpl set3 = set2.clone(); // save for later
// test addAll:
set2.addAll(set1);
assertTrue(set2.contains(k1));
assertFalse(set2.contains(k2));
assertTrue(set2.contains(k3));
// test removeAll:
set3.removeAll(set1);
assertTrue(set3.contains(k1));
assertFalse(set3.contains(k2));
assertFalse(set3.contains(k3));
assertEquals("size", 1, set3.size());
}