### Question:
OmPrefixInfoCodec implements Codec<OmPrefixInfo> { @Override public OmPrefixInfo fromPersistedFormat(byte[] rawData) throws IOException { Preconditions .checkNotNull(rawData, "Null byte array can't converted to real object."); try { return OmPrefixInfo.getFromProtobuf( PersistedPrefixInfo.parseFrom(rawData)); } catch (InvalidProtocolBufferException e) { throw new IllegalArgumentException( "Can't encode the the raw data from the byte array", e); } }  @Override byte[] toPersistedFormat(OmPrefixInfo object); @Override OmPrefixInfo fromPersistedFormat(byte[] rawData); @Override OmPrefixInfo copyObject(OmPrefixInfo object);  }### Answer:
@Test public void testCodecWithIncorrectValues() throws Exception { try { codec.fromPersistedFormat("random".getBytes(StandardCharsets.UTF_8)); fail("testCodecWithIncorrectValues failed"); } catch (IllegalArgumentException ex) { GenericTestUtils.assertExceptionContains("Can't encode the the raw " + "data from the byte array", ex); } }
@Test public void testCodecWithNullDataFromTable() throws Exception { thrown.expect(NullPointerException.class); codec.fromPersistedFormat(null); }