### Question:
IndexingService { public void reindexObjectAndChildren(AgentPrincipals agent, PID objectPid, Boolean inplace) { try (Timer.Context context = timer.time()) { aclService.assertHasAccess("User does not have permission to reindex", objectPid, agent.getPrincipals(), Permission.reindex); if (inplace == null || inplace) { indexingMessageSender.sendIndexingOperation(agent.getUsername(), objectPid, IndexingActionType.RECURSIVE_REINDEX); } else { indexingMessageSender.sendIndexingOperation(agent.getUsername(), objectPid, IndexingActionType.CLEAN_REINDEX); } } }  void reindexObjectAndChildren(AgentPrincipals agent, PID objectPid, Boolean inplace); void reindexObject(AgentPrincipals agent, PID objectPid); void setAclService(AccessControlService aclService); void setIndexingMessageSender(IndexingMessageSender indexingMessageSender);  }### Answer:
@Test public void inplaceReindexObjectAndChildrenTest() { service.reindexObjectAndChildren(agent, objPid, true); verify(messageSender).sendIndexingOperation(stringCaptor.capture(), pidCaptor.capture(), actionCaptor.capture()); verifyParameters(IndexingActionType.RECURSIVE_REINDEX); }
@Test public void cleanReindexObjectAndChildrenTest() { service.reindexObjectAndChildren(agent, objPid, false); verify(messageSender).sendIndexingOperation(stringCaptor.capture(), pidCaptor.capture(), actionCaptor.capture()); verifyParameters(IndexingActionType.CLEAN_REINDEX); }