File tree Expand file tree Collapse file tree
src/test/java/com/thealgorithms/datastructures/lists Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55import static org .junit .jupiter .api .Assertions .assertNull ;
66import static org .junit .jupiter .api .Assertions .assertTrue ;
77
8- import java .util .ArrayList ;
9- import java .util .List ;
108import org .junit .jupiter .api .BeforeEach ;
119import org .junit .jupiter .api .Test ;
1210
@@ -19,24 +17,6 @@ void setUp() {
1917 list = new SelfOrganizingLinkedList <>();
2018 }
2119
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-
4020 @ Test
4121 void testEmptyListAndGetters () {
4222 assertTrue (list .isEmpty ());
You can’t perform that action at this time.
0 commit comments