### Question:
S3SecretValueCodec implements Codec<S3SecretValue> { @Override public byte[] toPersistedFormat(S3SecretValue object) throws IOException { Preconditions .checkNotNull(object, "Null object can't be converted to byte array."); return object.getProtobuf().toByteArray(); }  @Override byte[] toPersistedFormat(S3SecretValue object); @Override S3SecretValue fromPersistedFormat(byte[] rawData); @Override S3SecretValue copyObject(S3SecretValue object);  }### Answer:
@Test public void testCodecWithNullDataFromUser() throws Exception { thrown.expect(NullPointerException.class); codec.toPersistedFormat(null); }