@Test public void testMap() { assertNull(Protected.object((Map<?, ?>) null)); assertSame(Collections.emptyMap(), Protected.object(Collections.emptyMap())); Map<String, String> singletonMap = new HashMap<String, String>(); singletonMap.put("a", "b"); assertEquals(Collections.singletonMap("a", "b").getClass(), Protected.object(singletonMap) .getClass()); Map<String, String> input = new HashMap<String, String>(); input.put("a", "b"); input.put("c", "d"); input.put("e", "f"); Map<String, String> output = Protected.object(input); assertEquals(input, output); assertNotSame(input, output); assertSame(output, Protected.object(output)); assertNotSame(output, Protected.object(input)); input.put("a", "q"); assertEquals("b", output.get("a")); try { output.put("a", "b"); fail(); } catch (UnsupportedOperationException expected) {} }
public static <J extends JsonDdlObject<J>> J object(J value) { if (value instanceof JsonDdlObject.Builder) { return ((JsonDdlObject.Builder<J>) value).build(); } return value; }
Protected { public static <J extends JsonDdlObject<J>> J object(J value) { if (value instanceof JsonDdlObject.Builder) { return ((JsonDdlObject.Builder<J>) value).build(); } return value; } }
Protected { public static <J extends JsonDdlObject<J>> J object(J value) { if (value instanceof JsonDdlObject.Builder) { return ((JsonDdlObject.Builder<J>) value).build(); } return value; }  }
Protected { public static <J extends JsonDdlObject<J>> J object(J value) { if (value instanceof JsonDdlObject.Builder) { return ((JsonDdlObject.Builder<J>) value).build(); } return value; }  static J object(J value); static List<T> object(List<T> values); static Map<K, V> object(Map<K, V> values); @SuppressWarnings("unchecked") static T object(T value); }
Protected { public static <J extends JsonDdlObject<J>> J object(J value) { if (value instanceof JsonDdlObject.Builder) { return ((JsonDdlObject.Builder<J>) value).build(); } return value; }  static J object(J value); static List<T> object(List<T> values); static Map<K, V> object(Map<K, V> values); @SuppressWarnings("unchecked") static T object(T value);  }