### Question:
AdminUnit extends ContentContainerObject { @Override public ContentContainerObject addMember(ContentObject member) throws ObjectTypeMismatchException { if (!(member instanceof CollectionObject)) { throw new ObjectTypeMismatchException("Cannot add object of type " + member.getClass().getName() + " as a member of AdminUnit " + pid.getQualifiedId()); } repoObjFactory.addMember(this, member); return this; } protected  AdminUnit(PID pid, RepositoryObjectDriver driver,
            RepositoryObjectFactory repoObjFactory); @Override ContentContainerObject addMember(ContentObject member); @Override AdminUnit validateType();  }### Answer:
@Test(expected = ObjectTypeMismatchException.class) public void addWorkMemberTest() { unit.addMember(workChildObj); }
@Test public void addCollectionObjectMemberTest() { unit.addMember(collectionChildObj); pidMinter.mintContentPid(); ArgumentCaptor<ContentObject> captor = ArgumentCaptor.forClass(ContentObject.class); verify(repoObjFactory).addMember(eq(unit), captor.capture()); ContentObject child = captor.getValue(); assertTrue("Incorrect type of child added", child instanceof CollectionObject); assertEquals("Child did not have the expected pid", collectionChildPid, child.getPid()); }