Revise SimpleLinkedListTest
Revise the file SimpleLinkedListTest.java given in the lecture in the following ways:
Create and populate a single linked list int values
Use this list to test each method you implement in the following ways
o Haveatleast1testcaseforsuccessfulcallingthetestedmethod
o
Haveatleast1testcaseforunsuccessfulcallingthetestedmethod.Forexamplecallingthemethod
public int get(int index) and passing an invalid index.
NOTE: since the code here is mainly for testing purpose, you do NOT HAVE to use the user input when
populating the list and testing your methods.
---------CODE SImpleLinkedListTest------------
package 1234;
public class SimpleLinkedListTest {
public static void main(String[] args) {
SimpleLinkedList numbers = new SimpleLinkedList();
numbers.add(10);
numbers.add(20);
numbers.add(30);
System.out.println(numbers.toString());
//System.out.println(numbers);
}
}
1. Original List
2. Successful calling of the method:
3. Unsuccessful (invalid Test case)
Get Answers For Free
Most questions answered within 1 hours.