public static <T> MutationDetector forValueWithCoder(T value, Coder<T> coder)
      throws CoderException {
    if (value == null) {
      return noopMutationDetector();
    } else {
      return new CodedValueMutationDetector<>(value, coder);
    }
  }
@Test
  public void testMutatingList() throws Exception {
    List<Integer> value = Arrays.asList(1, 2, 3, 4);
    MutationDetector detector =
        MutationDetectors.forValueWithCoder(value, ListCoder.of(VarIntCoder.of()));
    value.set(0, 37);

    thrown.expect(IllegalMutationException.class);
    detector.verifyUnmodified();
  }