add sort (ascending) method
This commit is contained in:
@@ -386,6 +386,17 @@ public class IntListTest {
|
||||
Assert.assertNotEquals(a.hashCode(), b.hashCode());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSort() {
|
||||
final IntList list = new IntList();
|
||||
|
||||
list.addAll(4, 2, 3, 1);
|
||||
list.sort();
|
||||
|
||||
final int[] expectedE = new int[] { 1, 2, 3, 4 };
|
||||
Assert.assertArrayEquals(expectedE, list.toArray());
|
||||
}
|
||||
|
||||
private int[] removeElements(final int[] data, final int... removedElements) {
|
||||
final int[] result = new int[data.length - removedElements.length];
|
||||
final List<Integer> blacklist = Arrays.stream(removedElements).boxed().collect(Collectors.toList());
|
||||
|
||||
Reference in New Issue
Block a user