| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5,8 +5,6 @@ | |||
| 5 | 5 | import static org.junit.jupiter.api.Assertions.assertNull; | |
| 6 | 6 | import static org.junit.jupiter.api.Assertions.assertTrue; | |
| 7 | 7 | ||
| 8 | - import java.util.ArrayList; | ||
| 9 | - import java.util.List; | ||
| 10 | 8 | import org.junit.jupiter.api.BeforeEach; | |
| 11 | 9 | import org.junit.jupiter.api.Test; | |
| 12 | 10 | ||
@@ -19,24 +17,6 @@ void setUp() { | |||
| 19 | 17 | list = new SelfOrganizingLinkedList<>(); | |
| 20 | 18 | } | |
| 21 | 19 | ||
| 22 | - /** Helper to extract all list elements in order via repeated search/head inspection. */ | ||
| 23 | - private List<Integer> toList() { | ||
| 24 | - List<Integer> result = new ArrayList<>(); | ||
| 25 | - int currentSize = list.getSize(); | ||
| 26 | - if (currentSize == 0) { | ||
| 27 | - return result; | ||
| 28 | - } | ||
| 29 | - | ||
| 30 | - // Search each node sequentially from head to verify integrity without breaking state | ||
| 31 | - for (int i = 0; i < currentSize; i++) { | ||
| 32 | - Integer val = list.getHeadValue(); | ||
| 33 | - result.add(val); | ||
| 34 | - // Move head to back by searching for it, allowing us to inspect the next element | ||
| 35 | - // or we can verify order by tracking transitions. | ||
| 36 | - } | ||
| 37 | - return result; | ||
| 38 | - } | ||
| 39 | - | ||
| 40 | 20 | @Test | |
| 41 | 21 | void testEmptyListAndGetters() { | |
| 42 | 22 | assertTrue(list.isEmpty()); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments