34 |
|
} |
35 |
|
|
36 |
|
/** |
37 |
< |
* clear removes all pairs |
37 |
> |
* clear removes all pairs |
38 |
|
*/ |
39 |
|
public void testClear() { |
40 |
|
TreeMap map = map5(); |
52 |
|
} |
53 |
|
|
54 |
|
/** |
55 |
< |
* Maps with same contents are equal |
55 |
> |
* Maps with same contents are equal |
56 |
|
*/ |
57 |
|
public void testEquals() { |
58 |
|
TreeMap map1 = map5(); |
65 |
|
} |
66 |
|
|
67 |
|
/** |
68 |
< |
* containsKey returns true for contained key |
68 |
> |
* containsKey returns true for contained key |
69 |
|
*/ |
70 |
|
public void testContainsKey() { |
71 |
|
TreeMap map = map5(); |
74 |
|
} |
75 |
|
|
76 |
|
/** |
77 |
< |
* containsValue returns true for held values |
77 |
> |
* containsValue returns true for held values |
78 |
|
*/ |
79 |
|
public void testContainsValue() { |
80 |
|
TreeMap map = map5(); |
83 |
|
} |
84 |
|
|
85 |
|
/** |
86 |
< |
* get returns the correct element at the given key, |
87 |
< |
* or null if not present |
86 |
> |
* get returns the correct element at the given key, |
87 |
> |
* or null if not present |
88 |
|
*/ |
89 |
|
public void testGet() { |
90 |
|
TreeMap map = map5(); |
94 |
|
} |
95 |
|
|
96 |
|
/** |
97 |
< |
* isEmpty is true of empty map and false for non-empty |
97 |
> |
* isEmpty is true of empty map and false for non-empty |
98 |
|
*/ |
99 |
|
public void testIsEmpty() { |
100 |
|
TreeMap empty = new TreeMap(); |
104 |
|
} |
105 |
|
|
106 |
|
/** |
107 |
< |
* firstKey returns first key |
107 |
> |
* firstKey returns first key |
108 |
|
*/ |
109 |
|
public void testFirstKey() { |
110 |
|
TreeMap map = map5(); |
112 |
|
} |
113 |
|
|
114 |
|
/** |
115 |
< |
* lastKey returns last key |
115 |
> |
* lastKey returns last key |
116 |
|
*/ |
117 |
|
public void testLastKey() { |
118 |
|
TreeMap map = map5(); |
121 |
|
|
122 |
|
|
123 |
|
/** |
124 |
< |
* keySet.toArray returns contains all keys |
124 |
> |
* keySet.toArray returns contains all keys |
125 |
|
*/ |
126 |
|
public void testKeySetToArray() { |
127 |
|
TreeMap map = map5(); |
134 |
|
} |
135 |
|
|
136 |
|
/** |
137 |
< |
* descendingkeySet.toArray returns contains all keys |
137 |
> |
* descendingkeySet.toArray returns contains all keys |
138 |
|
*/ |
139 |
|
public void testDescendingKeySetToArray() { |
140 |
|
TreeMap map = map5(); |
147 |
|
} |
148 |
|
|
149 |
|
/** |
150 |
< |
* keySet returns a Set containing all the keys |
150 |
> |
* keySet returns a Set containing all the keys |
151 |
|
*/ |
152 |
|
public void testKeySet() { |
153 |
|
TreeMap map = map5(); |
161 |
|
} |
162 |
|
|
163 |
|
/** |
164 |
< |
* keySet is ordered |
164 |
> |
* keySet is ordered |
165 |
|
*/ |
166 |
|
public void testKeySetOrder() { |
167 |
|
TreeMap map = map5(); |
199 |
|
} |
200 |
|
|
201 |
|
/** |
202 |
< |
* descendingKeySet is ordered |
202 |
> |
* descendingKeySet is ordered |
203 |
|
*/ |
204 |
|
public void testDescendingKeySetOrder() { |
205 |
|
TreeMap map = map5(); |
218 |
|
} |
219 |
|
|
220 |
|
/** |
221 |
< |
* descending iterator of descendingKeySet is ordered |
221 |
> |
* descending iterator of descendingKeySet is ordered |
222 |
|
*/ |
223 |
|
public void testDescendingKeySetDescendingIteratorOrder() { |
224 |
|
TreeMap map = map5(); |
289 |
|
} |
290 |
|
|
291 |
|
/** |
292 |
< |
* entrySet.toArray contains all entries |
292 |
> |
* entrySet.toArray contains all entries |
293 |
|
*/ |
294 |
|
public void testEntrySetToArray() { |
295 |
|
TreeMap map = map5(); |
303 |
|
} |
304 |
|
|
305 |
|
/** |
306 |
< |
* descendingEntrySet.toArray contains all entries |
306 |
> |
* descendingEntrySet.toArray contains all entries |
307 |
|
*/ |
308 |
|
public void testDescendingEntrySetToArray() { |
309 |
|
TreeMap map = map5(); |
317 |
|
} |
318 |
|
|
319 |
|
/** |
320 |
< |
* putAll adds all key-value pairs from the given map |
320 |
> |
* putAll adds all key-value pairs from the given map |
321 |
|
*/ |
322 |
|
public void testPutAll() { |
323 |
|
TreeMap empty = new TreeMap(); |
332 |
|
} |
333 |
|
|
334 |
|
/** |
335 |
< |
* remove removes the correct key-value pair from the map |
335 |
> |
* remove removes the correct key-value pair from the map |
336 |
|
*/ |
337 |
|
public void testRemove() { |
338 |
|
TreeMap map = map5(); |
541 |
|
} |
542 |
|
|
543 |
|
/** |
544 |
< |
* size returns the correct values |
544 |
> |
* size returns the correct values |
545 |
|
*/ |
546 |
|
public void testSize() { |
547 |
|
TreeMap map = map5(); |
992 |
|
// BitSet should support this! Test would run much faster |
993 |
|
while (key >= min) { |
994 |
|
if (bs.get(key)) |
995 |
< |
return(key); |
995 |
> |
return key; |
996 |
|
key--; |
997 |
|
} |
998 |
|
return -1; |