### Question:
VerifyObjectsAreInFedoraService { public List<PID> listObjectsNotInFedora(Collection<String> pids) { List<PID> objectsNotInFedora = new ArrayList<>(); for (String pid : pids) { PID childPid = PIDs.get(pid); if (!objectExists(childPid)) { objectsNotInFedora.add(childPid); } } return objectsNotInFedora; }  String listObjectPIDs(String depositPid, List<PID> objectPIDs); List<PID> listObjectsNotInFedora(Collection<String> pids); void setFcrepoClient(FcrepoClient fcrepoClient);  }### Answer:
@Test public void allObjectsInFedoraTest() throws FcrepoOperationFailedException { when(client.head(any(URI.class))).thenReturn(builder); when(builder.perform()).thenReturn(response); List<PID> objPids = verificationService.listObjectsNotInFedora(pids); assertEquals(0, objPids.size()); }
@Test public void listObjectsNotInFedoraTest() throws FcrepoOperationFailedException { when(client.head(any(URI.class))).thenReturn(builder); when(builder.perform()) .thenThrow(new FcrepoOperationFailedException(workPid.getRepositoryUri(), 404, "Not Found")); Collection<String> pids = new HashSet<>(); pids.add(workPid.toString()); pids.add(filePid.toString()); List<PID> objPids = verificationService.listObjectsNotInFedora(pids); assertEquals(2, objPids.size()); }