Guest User

Untitled

a guest
Jun 18th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.87 KB | None | 0 0
  1.  private static void testAfterInsertEnd() {
  2.     SList lst1 = new SList();
  3.     lst1.insertEnd(new Integer(6));
  4.     lst1.insertEnd(new Integer(7));
  5.     System.out.println();
  6.     System.out.println("Here is a list after insertEnd 6, 7: "
  7.                + lst1.toString());
  8.     System.out.println("isEmpty() should be false. It is: " +
  9.                lst1.isEmpty());
  10.     TestHelper.verify(lst1.isEmpty() == false,
  11.               "isEmpty() after insertEnd failed");    
  12.     System.out.println("length() should be 2. It is: " +
  13.                lst1.length());
  14.     TestHelper.verify(lst1.length() == 2,
  15.               "length() after insertEndfailed");
  16.     lst1.insertFront(new Integer(5));
  17.     System.out.println("Here is the same list after insertFront(5): "
  18.                + lst1.toString());
  19.     TestHelper.verify(lst1.toString().equals("[  5  6  7  ]"),
  20.               "insertFront after insertEnd failed");
  21.   }
  22. }
Add Comment
Please, Sign In to add comment