public static <T> ListCoder<T> of(Coder<T> elemCoder) {
    return new ListCoder<>(elemCoder);
  }
@Test
  public void testListWithNullsAndVarIntCoderThrowsException() throws Exception {
    thrown.expect(CoderException.class);
    thrown.expectMessage("cannot encode a null Integer");

    List<Integer> list = Arrays.asList(1, 2, 3, null, 4);
    Coder<List<Integer>> coder = ListCoder.of(VarIntCoder.of());
    CoderProperties.coderDecodeEncodeEqual(coder, list);
  }