Created
August 22, 2016 18:45
-
-
Save manoelf/11ff1fa95de9fe29189d8444dbe2587b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lista2.insertFirst(4); | |
lista2.insertFirst(3); | |
lista2.insertFirst(2); | |
lista2.insertFirst(1); | |
lista2.insertFirst(0); | |
Assert.assertArrayEquals(new Integer[] { 0, 1, 2, 3, 4 }, lista2.toArray()); | |
lista2.remove(0); | |
Assert.assertArrayEquals(new Integer[] { 1, 2, 3, 4 }, lista2.toArray()); | |
lista2.remove(1); | |
Assert.assertArrayEquals(new Integer[] { 2, 3, 4 }, lista2.toArray()); | |
lista2.remove(2); | |
Assert.assertArrayEquals(new Integer[] { 3, 4 }, lista2.toArray()); | |
lista2.remove(3); | |
Assert.assertArrayEquals(new Integer[] { 4 }, lista2.toArray()); | |
lista2.remove(4); | |
Assert.assertArrayEquals(new Integer[] {}, lista2.toArray()); | |
lista2.insertFirst(0); | |
lista2.insertFirst(1); | |
lista2.insertFirst(2); | |
lista2.insertFirst(3); | |
lista2.insertFirst(4); | |
Assert.assertArrayEquals(new Integer[] { 4, 3, 2, 1, 0 }, lista2.toArray()); | |
lista2.removeLast(); | |
Assert.assertArrayEquals(new Integer[] { 4, 3, 2, 1,}, lista2.toArray()); | |
lista2.removeLast(); | |
Assert.assertArrayEquals(new Integer[] { 4, 3, 2, }, lista2.toArray()); | |
lista2.removeLast(); | |
Assert.assertArrayEquals(new Integer[] { 4, 3 }, lista2.toArray()); | |
lista2.removeLast(); | |
Assert.assertArrayEquals(new Integer[] { 4 }, lista2.toArray()); | |
lista2.removeLast(); | |
Assert.assertArrayEquals(new Integer[] {}, lista2.toArray()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment