### Question:
WorkObject extends ContentContainerObject { @Override public ContentContainerObject addMember(ContentObject member) throws ObjectTypeMismatchException { if (!(member instanceof FileObject)) { throw new ObjectTypeMismatchException("Cannot add object of type " + member.getClass().getName() + " as a member of WorkObject " + pid.getQualifiedId()); } repoObjFactory.addMember(this, member); return this; } protected  WorkObject(PID pid, RepositoryObjectDriver driver, RepositoryObjectFactory repoObjFactory); @Override WorkObject validateType(); void clearPrimaryObject(); void setPrimaryObject(PID primaryPid); FileObject getPrimaryObject(); @Override ContentContainerObject addMember(ContentObject member); FileObject addDataFile(URI storageUri, String filename, String mimetype,
            String sha1Checksum, String md5Checksum); FileObject addDataFile(URI storageUri, String filename,
            String mimetype, String sha1Checksum, String md5Checksum, Model model); FileObject addDataFile(PID filePid, URI storageUri, String filename,
            String mimetype, String sha1Checksum, String md5Checksum, Model model);  }### Answer:
@Test public void addMemberFileObjectTest() { work.addMember(fileObj); verify(repoObjFactory).addMember(eq(work), eq(fileObj)); }
@Test(expected = ObjectTypeMismatchException.class) public void addMemberFolderTest() { FolderObject folderObj = mock(FolderObject.class); work.addMember(folderObj); verify(repoObjFactory).addMember(any(ContentObject.class), any(ContentObject.class)); }