6 |
|
|
7 |
|
import junit.framework.*; |
8 |
|
import java.util.*; |
9 |
– |
import java.util.concurrent.*; |
10 |
– |
import java.io.*; |
9 |
|
|
10 |
|
public class EntryTest extends JSR166TestCase { |
11 |
|
public static void main(String[] args) { |
20 |
|
static final String k2 = "2"; |
21 |
|
static final String v2 = "b"; |
22 |
|
|
25 |
– |
|
23 |
|
/** |
24 |
|
* A new SimpleEntry(k, v) holds k, v. |
25 |
|
*/ |
38 |
|
assertEquals(v1, s.getValue()); |
39 |
|
} |
40 |
|
|
44 |
– |
|
41 |
|
/** |
42 |
|
* A new SimpleEntry(entry(k, v)) holds k, v. |
43 |
|
*/ |
98 |
|
assertFalse(s2.equals(s)); |
99 |
|
} |
100 |
|
|
105 |
– |
|
101 |
|
/** |
102 |
|
* getValue returns last setValue for SimpleEntry |
103 |
|
*/ |
114 |
|
/** |
115 |
|
* setValue for SimpleImmutableEntry throws UnsupportedOperationException |
116 |
|
*/ |
117 |
< |
public void testsetValue2() { |
117 |
> |
public void testSetValue2() { |
118 |
|
Map.Entry s2 = new AbstractMap.SimpleImmutableEntry(k1, v1); |
119 |
|
Map.Entry s = new AbstractMap.SimpleImmutableEntry(s2); |
120 |
|
assertEquals(k1, s.getKey()); |