@SuppressWarnings("unchecked")
@Test
public void testRetainIntersection() {

    List<Integer> common = Lists.newArrayList();
    List<Integer>[] lists = new List[Random.getScaleCount()];
    int max = Random.getScaleCount();
    for (int i = 0; i < max; i++) {
        common.add(i);
    }
    for (int i = 0; i < lists.length; i++) {
        lists[i] = Lists.<Integer> newArrayList();
        lists[i].addAll(common);
        for (int j = 0; j < Random.getScaleCount(); j++) {
            lists[i].add(Random.getScaleCount() + max);
        }
        lists[i] = Lists.newArrayList(lists[i]);
    }
    TLists.retainIntersection(lists);
    for (List<Integer> list : lists) {
        Assert.assertEquals(common, list);
    }
}