### Question:
SoapTagService extends AbstractService implements TagService { @Override public void setDocumentTags(String sid, long docId, String[] tags) throws Exception { SoapDocumentService docService = getDocumentService(); WSDocument doc = docService.getDocument(sid, docId); if (doc == null) return; User user = validateSession(sid); checkWriteEnable(user, doc.getFolderId()); doc.setTags(tags); docService.update(sid, doc); }  @Override void setDocumentTags(String sid, long docId, String[] tags); @Override void addDocumentTags(String sid, long docId, String[] tags); @Override String[] getDocumentTags(String sid, long docId); @Override void setFolderTags(String sid, long folderId, String[] tags); @Override void addFolderTags(String sid, long folderId, String[] tags); @Override String[] getFolderTags(String sid, long folderId); @Override String[] getTags(String sid); @Override String[] getTagsPreset(String sid); @Override WSTagCloud[] getTagCloud(String sid); @Override WSDocument[] findDocumentsByTag(String sid, String tag); @Override WSFolder[] findFoldersByTag(String sid, String tag);  }### Answer:
@Test public void testSetDocumentTags() throws Exception { WSDocument[] documents = tagService.findDocumentsByTag("", "abc"); Assert.assertNotNull(documents); Assert.assertEquals(1, documents.length); tagService.setDocumentTags("", documents[0].getId(), new String[] { "pippo", "pluto" }); documents = tagService.findDocumentsByTag("", "pippo"); Assert.assertNotNull(documents); Assert.assertEquals(1, documents.length); documents = tagService.findDocumentsByTag("", "abc"); Assert.assertNotNull(documents); Assert.assertEquals(0, documents.length); }