@Test(expected = UnsupportedOperationException.class) public void testRetainAll1() throws Exception { Set<Integer> hashSet = Collections.emptySet(); es.retainAll(hashSet); }
@Test(expected = UnsupportedOperationException.class) public void testRetainAll2() throws Exception { IntSet sis = new SingletonIntSet(3); Set<Integer> hashSet = new HashSet<>(); sis.retainAll(hashSet); }
@Test(expected = UnsupportedOperationException.class) public void testRetainAll() throws Exception { IntSet rs = new RangeSet(5); es.retainAll(rs); }
@Test(expected = UnsupportedOperationException.class) public void testRetainAll1() throws Exception { IntSet sis = new SingletonIntSet(3); IntSet sis2 = new SingletonIntSet(3); sis.retainAll(sis2); }
@Test(expected = UnsupportedOperationException.class) public void retainAll1() throws Exception { IntSet rs = new RangeSet(5); SmallIntSet sis = new SmallIntSet(); rs.retainAll(sis); }
@Test(expected = UnsupportedOperationException.class) public void testRetainAll() throws Exception { IntSet sis = new SingletonIntSet(3); IntSet rs = new RangeSet(5); sis.retainAll(rs); }
@Test public void testRetainAll1() throws Exception { intSet.add(1); intSet.add(4); intSet.add(7); assertEquals(3, intSet.size()); // (0 - 4) IntSet rs = new RangeSet(5); assertTrue(intSet.retainAll(rs)); assertEquals(CollectionFactory.makeSet(1, 4), intSet); }
@Test public void testRetainAll2() throws Exception { intSet.add(1); intSet.add(4); intSet.add(7); assertEquals(3, intSet.size()); assertTrue(intSet.retainAll(CollectionFactory.makeSet(4, 5, 7))); assertEquals(CollectionFactory.makeSet(4, 7), intSet); }
@Test public void testRetainAll() throws Exception { intSet.add(1); intSet.add(4); intSet.add(7); assertEquals(3, intSet.size()); IntSet intSet2 = new SmallIntSet(); intSet2.add(4); intSet2.add(5); intSet2.add(7); intSet.retainAll(intSet2); assertEquals(CollectionFactory.makeSet(4, 7), intSet); }