package linkedLists; public class TestIntList { /** class to test the single linked list of integers methods */ public static void main(String[] args) { IntList myIntList = new IntList(); myIntList.addValueInOrder(67); myIntList.addValueInOrder(28); myIntList.addValueInOrder(94); myIntList.addValueInOrder(122); myIntList.addValueInOrder(9); System.out.println("The list is: " + myIntList); System.out.println("94 is in the list: " + myIntList.inList(94)); System.out.println("17 is in the list: " + myIntList.inList(17)); myIntList.removeValue(122); System.out.println("After removing 122, list is now: " + myIntList); System.out.println("size of list is now: " + myIntList.size()); myIntList.addValueInOrder(-7); myIntList.addValueInOrder(-7); System.out.println("After adding -7 twice, list is now: " + myIntList); System.out.println("size of list is now: " + myIntList.size()); System.out.println("The sum of the elements is: " + myIntList.sum()); myIntList.removeValue(-7); System.out.println("after removing nodes with value -7, list is now: " + myIntList); IntList myIntList2=new IntList(); myIntList2.addValueInOrder(9); myIntList2.addValueInOrder(-7); myIntList2.addValueInOrder(-2); myIntList2.addValueInOrder(0); myIntList2.addValueInOrder(0); myIntList2.addValueInOrder(5); System.out.println("second list is: " + myIntList2); myIntList2.delete0(); System.out.println("after removing 1st 0 list is: " + myIntList2); myIntList2.delete0(); System.out.println("after removing 2nd 0 list is: " + myIntList2); myIntList2.delete0(); System.out.println("after removing 3rd 0 list is: " + myIntList2); } }