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