35 |
|
TreeSet q = new TreeSet(); |
36 |
|
assertTrue(q.isEmpty()); |
37 |
|
|
38 |
< |
for(int i = n-1; i >= 0; i-=2) |
38 |
> |
for (int i = n-1; i >= 0; i-=2) |
39 |
|
assertTrue(q.add(new Integer(i))); |
40 |
< |
for(int i = (n & 1); i < n; i+=2) |
40 |
> |
for (int i = (n & 1); i < n; i+=2) |
41 |
|
assertTrue(q.add(new Integer(i))); |
42 |
|
assertTrue(q.add(new Integer(-n))); |
43 |
|
assertTrue(q.add(new Integer(n))); |
166 |
|
q.add(new Object()); |
167 |
|
shouldThrow(); |
168 |
|
} |
169 |
< |
catch(ClassCastException success) {} |
169 |
> |
catch (ClassCastException success) {} |
170 |
|
} |
171 |
|
|
172 |
|
|
413 |
|
NavigableSet q = populatedSet(SIZE); |
414 |
|
Object[] o = q.toArray(); |
415 |
|
Arrays.sort(o); |
416 |
< |
for(int i = 0; i < o.length; i++) |
416 |
> |
for (int i = 0; i < o.length; i++) |
417 |
|
assertEquals(o[i], q.pollFirst()); |
418 |
|
} |
419 |
|
|
425 |
|
Integer[] ints = new Integer[SIZE]; |
426 |
|
ints = (Integer[])q.toArray(ints); |
427 |
|
Arrays.sort(ints); |
428 |
< |
for(int i = 0; i < ints.length; i++) |
428 |
> |
for (int i = 0; i < ints.length; i++) |
429 |
|
assertEquals(ints[i], q.pollFirst()); |
430 |
|
} |
431 |
|
|
436 |
|
NavigableSet q = populatedSet(SIZE); |
437 |
|
int i = 0; |
438 |
|
Iterator it = q.iterator(); |
439 |
< |
while(it.hasNext()) { |
439 |
> |
while (it.hasNext()) { |
440 |
|
assertTrue(q.contains(it.next())); |
441 |
|
++i; |
442 |
|
} |
450 |
|
NavigableSet q = set0(); |
451 |
|
int i = 0; |
452 |
|
Iterator it = q.iterator(); |
453 |
< |
while(it.hasNext()) { |
453 |
> |
while (it.hasNext()) { |
454 |
|
assertTrue(q.contains(it.next())); |
455 |
|
++i; |
456 |
|
} |
505 |
|
assertEquals(q.size(), r.size()); |
506 |
|
while (!q.isEmpty()) |
507 |
|
assertEquals(q.pollFirst(), r.pollFirst()); |
508 |
< |
} catch(Exception e){ |
508 |
> |
} catch (Exception e){ |
509 |
|
e.printStackTrace(); |
510 |
|
unexpectedException(); |
511 |
|
} |
673 |
|
q.add(new Object()); |
674 |
|
shouldThrow(); |
675 |
|
} |
676 |
< |
catch(ClassCastException success) {} |
676 |
> |
catch (ClassCastException success) {} |
677 |
|
} |
678 |
|
|
679 |
|
|
920 |
|
NavigableSet q = populatedSet(SIZE); |
921 |
|
Object[] o = q.toArray(); |
922 |
|
Arrays.sort(o); |
923 |
< |
for(int i = 0; i < o.length; i++) |
923 |
> |
for (int i = 0; i < o.length; i++) |
924 |
|
assertEquals(o[i], q.pollFirst()); |
925 |
|
} |
926 |
|
|
932 |
|
Integer[] ints = new Integer[SIZE]; |
933 |
|
ints = (Integer[])q.toArray(ints); |
934 |
|
Arrays.sort(ints); |
935 |
< |
for(int i = 0; i < ints.length; i++) |
935 |
> |
for (int i = 0; i < ints.length; i++) |
936 |
|
assertEquals(ints[i], q.pollFirst()); |
937 |
|
} |
938 |
|
|
943 |
|
NavigableSet q = populatedSet(SIZE); |
944 |
|
int i = 0; |
945 |
|
Iterator it = q.iterator(); |
946 |
< |
while(it.hasNext()) { |
946 |
> |
while (it.hasNext()) { |
947 |
|
assertTrue(q.contains(it.next())); |
948 |
|
++i; |
949 |
|
} |
957 |
|
NavigableSet q = dset0(); |
958 |
|
int i = 0; |
959 |
|
Iterator it = q.iterator(); |
960 |
< |
while(it.hasNext()) { |
960 |
> |
while (it.hasNext()) { |
961 |
|
assertTrue(q.contains(it.next())); |
962 |
|
++i; |
963 |
|
} |
1012 |
|
assertEquals(q.size(), r.size()); |
1013 |
|
while (!q.isEmpty()) |
1014 |
|
assertEquals(q.pollFirst(), r.pollFirst()); |
1015 |
< |
} catch(Exception e){ |
1015 |
> |
} catch (Exception e){ |
1016 |
|
e.printStackTrace(); |
1017 |
|
unexpectedException(); |
1018 |
|
} |