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