### Question:
RepositoryObjectLoader { public RepositoryObject getRepositoryObject(PID pid) { try { return repositoryObjCache.get(pid); } catch (UncheckedExecutionException | ExecutionException e) { Throwable cause = e.getCause(); if (cause instanceof RuntimeException) { throw (RuntimeException) cause; } else { throw new FedoraException((Exception) cause); } } }  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 getRepositoryObjectFolderTest() throws Exception { PID pid = pidMinter.mintContentPid(); when(objectCacheLoader.load(eq(pid))).thenReturn(mock(FolderObject.class)); RepositoryObject resultObj = repoObjLoader.getRepositoryObject(pid); assertTrue(resultObj instanceof FolderObject); }
@Test(expected = NotFoundException.class) public void getRepositoryObjectExecutionExceptionTest() throws Exception { PID pid = pidMinter.mintContentPid(); FedoraException fedoraE = new NotFoundException("Not found"); when(objectCacheLoader.load(eq(pid))).thenThrow(fedoraE); repoObjLoader.getRepositoryObject(pid); }