@Test public void testList() { assertNull(Protected.object((List<?>) null)); assertSame(Collections.emptyList(), Protected.object(Collections.emptyList())); assertEquals(Collections.singletonList("a").getClass(), Protected.object(Arrays.asList("b")) .getClass()); List<String> input = Arrays.asList("a", "b", "c"); List<String> output = Protected.object(input); assertEquals(input, output); assertNotSame(input, output); assertSame(output, Protected.object(output)); assertNotSame(output, Protected.object(input)); input.set(0, "b"); assertEquals("a", output.get(0)); try { output.set(0, "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);  }