### Question:
RepositoryObjectLoader { public DepositRecord getDepositRecord(PID pid) { RepositoryObject repoObj = getRepositoryObject(pid); if (!(repoObj instanceof DepositRecord)) { throw new ObjectTypeMismatchException("Object with pid " + pid + " is not a deposit record"); } return (DepositRecord) repoObj; }  void init(); void setRepositoryObjectCacheLoader(RepositoryObjectCacheLoader cacheLoader); void setCacheMaxSize(long maxSize); void setCacheTimeToLive(long timeToLive); AdminUnit getAdminUnit(PID pid); CollectionObject getCollectionObject(PID pid); ContentRootObject getContentRootObject(PID pid); FolderObject getFolderObject(PID pid); WorkObject getWorkObject(PID pid); FileObject getFileObject(PID pid); BinaryObject getBinaryObject(PID pid); DepositRecord getDepositRecord(PID pid); Tombstone getTombstone(PID pid); RepositoryObject getRepositoryObject(PID pid);  }### Answer:
@Test public void getDepositRecordTest() { PID pid = pidMinter.mintDepositRecordPid(); when(objectCacheLoader.load(eq(pid))).thenReturn(mock(DepositRecord.class)); assertNotNull(repoObjLoader.getDepositRecord(pid)); }
@Test(expected = ObjectTypeMismatchException.class) public void getDepositRecordWrongTypeTest() { PID pid = pidMinter.mintDepositRecordPid(); when(objectCacheLoader.load(eq(pid))).thenReturn(mock(WorkObject.class)); repoObjLoader.getDepositRecord(pid); }