@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);
  // Protecting a protected list should be idempotent
  assertSame(output, Protected.object(output));
  // But re-protecting the input list shouldn't be
  assertNotSame(output, Protected.object(input));
  // Mutations to input list aren't visible
  input.set(0, "b");
  assertEquals("a", output.get(0));
  // Changes to the protected list fail
  try {
    output.set(0, "b");
    fail();
  } catch (UnsupportedOperationException expected) {}
}