### Question:
Media { public File getFile() { MediaData md = getMediaData(); return md == null ? null : md.getFile(); } Media();  Media(Cursor c); byte[] getRawData(); String getMimeType(); String getUrl(); int getSize(); File getFile(); long getFileSize(); @Override String toString();  }### Answer:
@Test public void shouldHandleSerializedDataOfWrongType() throws Exception { Media media = new Media(); media.thumb_image = fileToBytes(Fixtures.VECTOR_SERIALIZED); assertThat(media.getFile()).isNull(); }
@Test public void shouldHandleInvalidSerializedData() throws Exception { Media media = new Media(); media.thumb_image = new byte[] {(byte) 0xde, (byte) 0xad, (byte) 0xbe, (byte) 0xef}; assertThat(media.getFile()).isNull(); }