### Question:
JpaCustomTagPersistenceService implements CustomTagPersistenceService { @Override public void deleteTagsForContent(String... contentId) { if (contentId != null && contentId.length > 0) em.createQuery("delete from Tag t where t.contentId in ?1").setParameter(1, Arrays.asList(contentId)) .executeUpdate(); }  @Override List<Tag> getTagsByContent(String... contentId); @Override List<Tag> getTagsByContentType(String contentType); @Override boolean createTag(Tag tag); @Override void deleteTag(String contentId, String tagLabel); @Override void deleteTagsForContent(String... contentId); @Override void changeOwnershipOfTags(String contributorFrom, String contributorTo);  }### Answer:
@Test public void deleteTagsForContent() { JpaCustomTagPersistenceService tested = getTested(); Tag tag1 = new Tag(CONTENT_TYPE_1_ID_1, CONTRIB_ID_1, "label1"); Tag tag2 = new Tag(CONTENT_TYPE_1_ID_1, CONTRIB_ID_2, "label2"); Tag tag3 = new Tag(CONTENT_TYPE_1_ID_2, CONTRIB_ID_2, "label3"); em.getTransaction().begin(); tested.createTag(tag1); tested.createTag(tag2); tested.createTag(tag3); em.getTransaction().commit(); em.getTransaction().begin(); tested.deleteTagsForContent((String[]) null); List<Tag> ret = tested.getTagsByContentType(CONTENT_TYPE_1); Assert.assertEquals(3, ret.size()); em.getTransaction().commit(); em.getTransaction().begin(); tested.deleteTagsForContent(CONTENT_TYPE_1_ID_1); ret = tested.getTagsByContentType(CONTENT_TYPE_1); Assert.assertEquals(1, ret.size()); Tag testedTag = ret.get(0); Assert.assertEquals(CONTENT_TYPE_1_ID_2, testedTag.getContentId()); Assert.assertEquals(CONTRIB_ID_2, testedTag.getContributorId()); Assert.assertEquals("label3", testedTag.getTagLabel()); em.getTransaction().commit(); }