/** * Creates a new {@code MutationDetector} for the provided {@code value} that uses the provided * {@link Coder} to perform deep copies and comparisons by serializing and deserializing values. * * <p>It is permissible for {@code value} to be {@code null}. Since {@code null} is immutable, the * mutation check will always succeed. */ public static <T> MutationDetector forValueWithCoder(T value, Coder<T> coder) throws CoderException { if (value == null) { return noopMutationDetector(); } else { return new CodedValueMutationDetector<>(value, coder); } }