-
Notifications
You must be signed in to change notification settings - Fork 0
/
OrderedAListTester.java
66 lines (57 loc) · 1.36 KB
/
OrderedAListTester.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
public class OrderedAListTester{
public static void main(String[] args){
StringComparator sComp = new StringComparator();
OrderedAList<String> test = new OrderedAList<String>(sComp);
/*******************************
Testing the add, contains, get, remove method
Should print unless commented out:
//EmptyStackException
//EmptyStackException
5
true
false
a
b
c
d
e
//IndexOutOfBException
a
null
4
false
false
b
c
0
true
**********************************/
//test.remove("meme");
//test.contains("meme");
System.out.println(sComp.compare("a","b"));
test.add("a");
test.add("b");
test.add("c");
test.add("d");
test.add("e");
System.out.println(test.size());
System.out.println(test.contains("a"));
System.out.println(test.contains("foo"));
System.out.println(test.get(0));
System.out.println(test.get(1));
System.out.println(test.get(2));
System.out.println(test.get(3));
System.out.println(test.get(4));
//System.out.println(test.get(10));
System.out.println(test.remove("a"));
System.out.println(test.remove("foo"));
System.out.println(test.size());
System.out.println(test.contains("foo"));
System.out.println(test.contains("a"));
System.out.println(test.get(0));
System.out.println(test.get(1));
test.clear();
System.out.println(test.size());
System.out.println(test.isEmpty());
}
}