+ @Test
+ public void testOrderedCopyOf() {
+ final Map<String, String> t = Collections.singletonMap("k1", "v1");
+ final Map<String, String> m = SharedSingletonMap.orderedCopyOf(t);
+ assertTrue(t.equals(m));
+ assertTrue(m.equals(t));
+ }
+
+ @Test
+ public void testUnorderedCopyOf() {
+ final Map<String, String> t = Collections.singletonMap("k1", "v1");
+ final Map<String, String> m = SharedSingletonMap.unorderedCopyOf(t);
+ assertTrue(t.equals(m));
+ assertTrue(m.equals(t));
+ }
+
+ @Test(expected=IllegalArgumentException.class)
+ public void testEmptyOrderedCopyOf() {
+ SharedSingletonMap.orderedCopyOf(ImmutableMap.of());
+ }
+
+ @Test(expected=IllegalArgumentException.class)
+ public void testEmptyUnorderedCopyOf() {
+ SharedSingletonMap.unorderedCopyOf(ImmutableMap.of());
+ }
+