180 |
|
return a; |
181 |
|
} |
182 |
|
|
183 |
< |
/* |
183 |
> |
/** |
184 |
|
* replaceAll replaces all matching values. |
185 |
|
*/ |
186 |
|
public void testReplaceAll() { |
187 |
|
ConcurrentHashMap<Integer, String> map = map5(); |
188 |
< |
map.replaceAll((x, y) -> {return x > 3 ? "Z" : y;}); |
188 |
> |
map.replaceAll((x, y) -> { return x > 3 ? "Z" : y; }); |
189 |
|
assertEquals("A", map.get(one)); |
190 |
|
assertEquals("B", map.get(two)); |
191 |
|
assertEquals("C", map.get(three)); |
1003 |
|
public void testSearchValuesSequentially() { |
1004 |
|
ConcurrentHashMap<Long, Long> m = longMap(); |
1005 |
|
Long r; |
1006 |
< |
r = m.searchValues(Long.MAX_VALUE, (Long x) -> x.longValue() == (long)(SIZE/2)? x : null); |
1006 |
> |
r = m.searchValues(Long.MAX_VALUE, |
1007 |
> |
(Long x) -> (x.longValue() == (long)(SIZE/2)) ? x : null); |
1008 |
|
assertEquals((long)r, (long)(SIZE/2)); |
1009 |
< |
r = m.searchValues(Long.MAX_VALUE, (Long x) -> x.longValue() < 0L ? x : null); |
1009 |
> |
r = m.searchValues(Long.MAX_VALUE, |
1010 |
> |
(Long x) -> (x.longValue() < 0L) ? x : null); |
1011 |
|
assertNull(r); |
1012 |
|
} |
1013 |
|
|