xxxxxxxxxx
Book bookFetched = em.find(Book.class, book.getId());
Assertions.assertNotNull(bookFetched.getCover());
byte[] cover = bookFetched.getCover();
try (FileOutputStream fos
= new FileOutputStream("C:\temp\testBook.png")) {
fos.write(cover);
} catch (Exception e) {
e.printStackTrace();
}