BAEL-4717: Refactor examples

This commit is contained in:
Daniel Strmecki 2020-11-17 11:00:56 +01:00
parent cc1a2e9b15
commit 79fc666e07
2 changed files with 3 additions and 3 deletions

View File

@ -14,9 +14,9 @@ public class ArrayListUnitTest {
void givenArrayList_whenItemAddedToSpecificIndex_thenItCanBeRetrieved() {
List<String> list = new ArrayList<>();
list.add("Daniel");
list.add(1, "Marko");
list.add(0, "Marko");
assertThat(list).hasSize(2);
assertThat(list.get(1)).isEqualTo("Marko");
assertThat(list.get(0)).isEqualTo("Marko");
}
@Test

View File

@ -15,7 +15,7 @@ public class LinkedListUnitTest {
void givenLinkedList_whenItemIsAppended_thenItCanBeRetrieved() {
LinkedList<String> list = new LinkedList<>();
list.addLast("Daniel");
list.addFirst( "Marko");
list.addFirst("Marko");
assertThat(list).hasSize(2);
assertThat(list.getLast()).isEqualTo("Daniel");
}