// TODO test
 @Override
 @Transactional(readOnly = false)
 public BookTo saveBook(BookTo book) {
   if (!book.getLibraryId().equals(null)) {
     LibraryEntity libraryEntity = libraryRepository.getOne(book.getLibraryId());
     if (!libraryEntity.equals(null)) {
       BookEntity entity = BookMapper.map(book);
       entity.setLibrary(libraryEntity);
       entity = bookRepository.save(entity);
       return BookMapper.map(entity);
     }
   }
   return null;
 }
 // @Override
 @Transactional(readOnly = false)
 public BookTo saveBook2(BookTo book) {
   BookEntity entity = BookMapper.map(book);
   entity = bookRepository.save(entity);
   return BookMapper.map(entity);
 }