### Question:
WorkObject extends ContentContainerObject { @Override public WorkObject validateType() throws FedoraException { if (!isType(Cdr.Work.toString())) { throw new ObjectTypeMismatchException("Object " + pid + " is not a Work object."); } 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 validTypeTest() { assertEquals(work, work.validateType()); }
@Test(expected = ObjectTypeMismatchException.class) public void invalidTypeTest() { types = Arrays.asList(PcdmModels.Object.getURI(), Cdr.Folder.getURI()); assertEquals(work, work.validateType()); }