29 |
|
* Returns a new map from Items 1-5 to Strings "A"-"E". |
30 |
|
*/ |
31 |
|
private static NavigableMap<Item,String> map5() { |
32 |
< |
TreeMap<Item,String> map = new TreeMap<Item,String>(); |
32 |
> |
TreeMap<Item,String> map = new TreeMap<>(); |
33 |
|
assertTrue(map.isEmpty()); |
34 |
|
map.put(zero, "Z"); |
35 |
|
map.put(one, "A"); |
44 |
|
} |
45 |
|
|
46 |
|
private static NavigableMap<Item,String> map0() { |
47 |
< |
TreeMap<Item,String> map = new TreeMap<Item,String>(); |
47 |
> |
TreeMap<Item,String> map = new TreeMap<>(); |
48 |
|
assertTrue(map.isEmpty()); |
49 |
|
return map.tailMap(one, true); |
50 |
|
} |
53 |
|
* Returns a new map from Items -5 to -1 to Strings "A"-"E". |
54 |
|
*/ |
55 |
|
private static NavigableMap<Item,String> dmap5() { |
56 |
< |
TreeMap<Item,String> map = new TreeMap<Item,String>(); |
56 |
> |
TreeMap<Item,String> map = new TreeMap<>(); |
57 |
|
assertTrue(map.isEmpty()); |
58 |
|
map.put(minusOne, "A"); |
59 |
|
map.put(minusFive, "E"); |
66 |
|
} |
67 |
|
|
68 |
|
private static NavigableMap<Item,String> dmap0() { |
69 |
< |
TreeMap<Item,String> map = new TreeMap<Item,String>(); |
69 |
> |
TreeMap<Item,String> map = new TreeMap<>(); |
70 |
|
assertTrue(map.isEmpty()); |
71 |
|
return map; |
72 |
|
} |
735 |
|
NavigableMap<Item,String> map = dmap5(); |
736 |
|
Collection<String> v = map.values(); |
737 |
|
String[] ar = v.toArray(new String[0]); |
738 |
< |
ArrayList<String> s = new ArrayList<String>(Arrays.asList(ar)); |
738 |
> |
ArrayList<String> s = new ArrayList<>(Arrays.asList(ar)); |
739 |
|
mustEqual(5, ar.length); |
740 |
|
assertTrue(s.contains("A")); |
741 |
|
assertTrue(s.contains("B")); |