Question: A junit test class which should test all the functions you implmented linkedlist tester sample A generic List interface, which encapsulates the ADT for a

 A junit test class which should test all the functions youimplmented linkedlist tester sample A generic List interface, which encapsulates the ADT

A junit test class which should test all the functions you implmented
linkedlist tester sample for a list data structure. A generic Linked List class, which implements

A generic List interface, which encapsulates the ADT for a list data structure. A generic Linked List class, which implements List interface A generic LinkedListNode class A Junit test class LinkedList Tester, which should test all the functions you imple- mented in your LinkedList class and LinkedListNode class. 3 ADT for a list data structure /** * Get data stored in head node of list. ** public T get First(); /** * Get the head node of the list. **/ public ListNode getFirstNode(); /** * Get data stored in tail node of list. **/ public T getLast(); * * Insert a new node with data at the head of the list. * public void insert First ( T data ); /** * Insert a new node with data after currentNode **/ public void insert After ( ListNode currentNode, T data); /** * Insert a new node with data at the tail of the list. **/ public void insert Last ( T data ); * Remove head node public void delete First(); /** * Remove tail node * public void deleteLast (); /** * Remove node following currentNode * If no node exists (i.e., currentNode is the tail), do nothing ** public void delete Next ( ListNode currentNode ); * Get the number of elements in this list. **/ public int size(); import statie org.unit.Assert.assertEquals; import statie org. junit.jupiter.api. Assertions.; import org.junit. Jupiter.api. Test; class LinkedList Tester Sample { e Test void test sample() { 1/ Make an empty string List newList - new LinkedList W", newList.toString()); 1/ Add an e at the beginning newList.insertpirst("e"): Y // Test to see if it showed up assertEquals("Test 4","e -> -> w.newList.toString(); // Add an v at the beginning nevtist.insertFirst("v"); // Test to see if it showed up assertEquals("Test 5","v -> -> b -> w, newList.toString(); // Add an 1 at the beginning nevtist.insertFirst("1"); // Test to see if it showed up assertEquals("Test 6","1 -> V -> -> b ->w, newList.toString()); // Add an i at the beginning newlist.insertFirst(""); // Test to see if it showed up assertEquals("Test 7", 1 -> 1-> V > -> b -> W" nevtist.toString(); 17 Make a helper node so we don't have to keep doing nevlist.getFirstNode() ListNode currentNode = newList.getPirstNode ; // Add a o after the node after the head node Devlist.insertAfter (currentNode.getNext , " "); // Make sure it showed up assertEquals("Test 8,1 - 1 -> -> -> -> -> W nevtist.toString(); A generic List interface, which encapsulates the ADT for a list data structure. A generic Linked List class, which implements List interface A generic LinkedListNode class A Junit test class LinkedList Tester, which should test all the functions you imple- mented in your LinkedList class and LinkedListNode class. 3 ADT for a list data structure /** * Get data stored in head node of list. ** public T get First(); /** * Get the head node of the list. **/ public ListNode getFirstNode(); /** * Get data stored in tail node of list. **/ public T getLast(); * * Insert a new node with data at the head of the list. * public void insert First ( T data ); /** * Insert a new node with data after currentNode **/ public void insert After ( ListNode currentNode, T data); /** * Insert a new node with data at the tail of the list. **/ public void insert Last ( T data ); * Remove head node public void delete First(); /** * Remove tail node * public void deleteLast (); /** * Remove node following currentNode * If no node exists (i.e., currentNode is the tail), do nothing ** public void delete Next ( ListNode currentNode ); * Get the number of elements in this list. **/ public int size(); import statie org.unit.Assert.assertEquals; import statie org. junit.jupiter.api. Assertions.; import org.junit. Jupiter.api. Test; class LinkedList Tester Sample { e Test void test sample() { 1/ Make an empty string List newList - new LinkedList W", newList.toString()); 1/ Add an e at the beginning newList.insertpirst("e"): Y // Test to see if it showed up assertEquals("Test 4","e -> -> w.newList.toString(); // Add an v at the beginning nevtist.insertFirst("v"); // Test to see if it showed up assertEquals("Test 5","v -> -> b -> w, newList.toString(); // Add an 1 at the beginning nevtist.insertFirst("1"); // Test to see if it showed up assertEquals("Test 6","1 -> V -> -> b ->w, newList.toString()); // Add an i at the beginning newlist.insertFirst(""); // Test to see if it showed up assertEquals("Test 7", 1 -> 1-> V > -> b -> W" nevtist.toString(); 17 Make a helper node so we don't have to keep doing nevlist.getFirstNode() ListNode currentNode = newList.getPirstNode ; // Add a o after the node after the head node Devlist.insertAfter (currentNode.getNext , " "); // Make sure it showed up assertEquals("Test 8,1 - 1 -> -> -> -> -> W nevtist.toString()

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!