provider.setExtraClass(new Class[]{SuperBook.class});
provider.init(Collections.singletonList(cri));
JAXBContext bookContext = provider.getJAXBContext(Book.class, Book.class);
ByteArrayOutputStream os = new ByteArrayOutputStream();
bookContext.createMarshaller().marshal(new SuperBook("name", 1L, 2L), os);
SuperBook book = (SuperBook)bookContext.createUnmarshaller()
.unmarshal(new ByteArrayInputStream(os.toByteArray()));
assertEquals(2L, book.getSuperId());
}