### Question:
RepositoryObjectFactory { public void addMember(ContentObject parent, ContentObject member) { createExclusiveRelationship(member, PcdmModels.memberOf, parent.getResource()); }  DepositRecord createDepositRecord(Model model); DepositRecord createDepositRecord(PID pid, Model model); AdminUnit createAdminUnit(Model model); AdminUnit createAdminUnit(PID pid, Model model); URI createContentRootObject(URI path, Model model); CollectionObject createCollectionObject(Model model); CollectionObject createCollectionObject(PID pid, Model model); FolderObject createFolderObject(Model model); FolderObject createFolderObject(PID pid, Model model); WorkObject createWorkObject(Model model); WorkObject createWorkObject(PID pid, Model model); FileObject createFileObject(Model model); FileObject createFileObject(PID pid, Model model); BinaryObject createOrUpdateBinary(PID pid, URI storageUri, String filename, String mimetype,
            String sha1Checksum, String md5Checksum, Model model); BinaryObject createBinary(URI path, String slug, InputStream content, String filename, String mimetype,
            String sha1Checksum, String md5Checksum, Model model); BinaryObject updateBinary(URI path, String slug, InputStream content, String filename, String mimetype,
             String sha1Checksum, String md5Checksum, Model model); void addMember(ContentObject parent, ContentObject member); void createProperty(RepositoryObject subject, Property property, String object); void createExclusiveRelationship(RepositoryObject repoObj, Property property, Object object); void deleteProperty(RepositoryObject repoObj, Property property); void createRelationship(RepositoryObject subject, Property property, Resource object); void createRelationships(RepositoryObject subject, Model model); URI createOrTransformObject(URI uri, Model model); boolean objectExists(URI uri); void setClient(FcrepoClient client); FcrepoClient getClient(); LdpContainerFactory getLdpFactory(); void setLdpFactory(LdpContainerFactory ldpFactory); void setRepositoryObjectDriver(RepositoryObjectDriver repoObjDriver); void setPidMinter(RepositoryPIDMinter pidMinter); void setSparqlUpdateService(SparqlUpdateService sparqlUpdateService);  }### Answer:
@Test public void addMemberTest() { PID parentPid = pidMinter.mintContentPid(); ContentObject parent = mock(ContentObject.class); when(parent.getPid()).thenReturn(parentPid); when(parent.getUri()).thenReturn(parentPid.getRepositoryUri()); when(parent.getResource()).thenReturn(createResource(parentPid.getRepositoryPath())); Model memberModel = ModelFactory.createDefaultModel(); PID memberPid = pidMinter.mintContentPid(); ContentObject member = mock(ContentObject.class); when(member.getPid()).thenReturn(memberPid); when(member.getModel()).thenReturn(memberModel); when(member.getMetadataUri()).thenReturn(memberPid.getRepositoryUri()); repoObjFactory.addMember(parent, member); verify(sparqlUpdateService).executeUpdate(eq(memberPid.getRepositoryPath()), anyString()); }