### Question:
JpaCategoryRepository implements CategoryRepository { @Override public Category save(Category item) { JpaCategory category = categoryConverter.convert(item); return saveOrUpdate(category.getEntityId(), manager, category); }  @Override Class<? extends Category> getType(); @Override Category get(String id); @Override Category save(Category item); @Override void delete(Category item); @Override List<Category> getAll(); @Override List<Category> getLimitedList(int offset, int limit); @Override int getCountAll(); @Override int removeFromCreatedOrModifiedFields(String userId);  }### Answer:
@Test @Ignore public void save_duplicateText_exception() { Date now = new Date(); User user = new JpaUser(1L); JpaCategory wc = new JpaCategory(); wc.setText(DUPLICATE_TEXT_VALUE); wc.setCreatedDate(now); wc.setCreatedUserId(user.getId()); wc.setLastModifiedDate(now); wc.setLastModifiedUserId(user.getId()); boolean gotExpectedException = false; try { repository.save(wc); manager.flush(); } catch (PersistenceException e) { assertThat(e.getCause().toString().contains("Unique"), is(true)); gotExpectedException = true; } finally { if (!gotExpectedException) { fail("Expected to get a PersistenceException due to Unique Constraint Violation"); } } }