4 |
|
* http://creativecommons.org/publicdomain/zero/1.0/ |
5 |
|
*/ |
6 |
|
|
7 |
< |
import junit.framework.*; |
8 |
< |
import java.util.*; |
9 |
< |
import java.util.concurrent.*; |
10 |
< |
import java.io.*; |
7 |
> |
import java.util.AbstractMap; |
8 |
> |
import java.util.Map; |
9 |
> |
|
10 |
> |
import junit.framework.Test; |
11 |
> |
import junit.framework.TestSuite; |
12 |
|
|
13 |
|
public class EntryTest extends JSR166TestCase { |
14 |
|
public static void main(String[] args) { |
23 |
|
static final String k2 = "2"; |
24 |
|
static final String v2 = "b"; |
25 |
|
|
25 |
– |
|
26 |
|
/** |
27 |
|
* A new SimpleEntry(k, v) holds k, v. |
28 |
|
*/ |
41 |
|
assertEquals(v1, s.getValue()); |
42 |
|
} |
43 |
|
|
44 |
– |
|
44 |
|
/** |
45 |
|
* A new SimpleEntry(entry(k, v)) holds k, v. |
46 |
|
*/ |
101 |
|
assertFalse(s2.equals(s)); |
102 |
|
} |
103 |
|
|
105 |
– |
|
104 |
|
/** |
105 |
|
* getValue returns last setValue for SimpleEntry |
106 |
|
*/ |
117 |
|
/** |
118 |
|
* setValue for SimpleImmutableEntry throws UnsupportedOperationException |
119 |
|
*/ |
120 |
< |
public void testsetValue2() { |
120 |
> |
public void testSetValue2() { |
121 |
|
Map.Entry s2 = new AbstractMap.SimpleImmutableEntry(k1, v1); |
122 |
|
Map.Entry s = new AbstractMap.SimpleImmutableEntry(s2); |
123 |
|
assertEquals(k1, s.getKey()); |