add method retainAll
This commit is contained in:
@@ -626,7 +626,7 @@ public class IntListTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void replaceAllOnEmptyList() {
|
||||
public void testReplaceAllOnEmptyList() {
|
||||
final IntList list = new IntList();
|
||||
|
||||
list.replaceAll(i -> i * 3);
|
||||
@@ -634,7 +634,7 @@ public class IntListTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void removeAll() {
|
||||
public void testRemoveAll() {
|
||||
final IntList list = IntList.of(-2, -1, 0, 1, 2, 3, 4, 5, 6);
|
||||
final IntList remove = IntList.of(-1, 2, 4, 5);
|
||||
|
||||
@@ -644,7 +644,7 @@ public class IntListTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void removeEmptyList() {
|
||||
public void testRemoveEmptyList() {
|
||||
final IntList list = IntList.of(1, 2, 3, 4, 5, 6);
|
||||
final IntList remove = new IntList();
|
||||
|
||||
@@ -654,7 +654,7 @@ public class IntListTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void removeAllFromEmptyList() {
|
||||
public void testRemoveAllFromEmptyList() {
|
||||
final IntList list = new IntList();
|
||||
final IntList remove = IntList.of(1);
|
||||
|
||||
@@ -662,4 +662,34 @@ public class IntListTest {
|
||||
Assert.assertArrayEquals(new int[] {}, list.toArray());
|
||||
Assert.assertEquals(0, list.size());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRetainAll() {
|
||||
final IntList list = IntList.of(-2, -1, 0, 1, 2, 3, 4, 5, 6);
|
||||
final IntList retain = IntList.of(-1, 2, 4, 5, 99);
|
||||
|
||||
list.retainAll(retain);
|
||||
Assert.assertArrayEquals(new int[] { -1, 2, 4, 5 }, list.toArray());
|
||||
Assert.assertArrayEquals(new int[] { -1, 2, 4, 5, 99 }, retain.toArray());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRetainAllOnEmptyList() {
|
||||
final IntList list = IntList.of();
|
||||
final IntList retain = IntList.of(-1, 2, 4, 5, 99);
|
||||
|
||||
list.retainAll(retain);
|
||||
Assert.assertArrayEquals(new int[] {}, list.toArray());
|
||||
Assert.assertArrayEquals(new int[] { -1, 2, 4, 5, 99 }, retain.toArray());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRetainAllFromEmptyList() {
|
||||
final IntList list = IntList.of(-2, -1, 0, 1, 2);
|
||||
final IntList retain = IntList.of();
|
||||
|
||||
list.retainAll(retain);
|
||||
Assert.assertArrayEquals(new int[] {}, list.toArray());
|
||||
Assert.assertArrayEquals(new int[] {}, retain.toArray());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user