### Question:
TenantServiceImpl extends HibernateDaoImpl implements TenantService, TenantPersistenceResolver, Diagnostic { @Override public Map<DiagnosticAttribute, DiagnosticCallback> getDiagnosticData() { return new DiagnosticAttributeBuilder() .addDiagnosticAttribute(DiagnosticAttributeBuilder.TOTAL_ORGANIZATIONS_COUNT, new DiagnosticCallback<Integer>() { @Override public Integer getDiagnosticAttributeValue() { return getTotalTenantsCount(null); } }).build(); }  void setDatabaseCharactersEscapeResolver(DatabaseCharactersEscapeResolver databaseCharactersEscapeResolver); ResourceFactory getPersistentClassFactory(); void setPersistentClassFactory(ResourceFactory persistentClassFactory); ResourceFactory getObjectMappingFactory(); void setObjectMappingFactory(ResourceFactory objectFactory); boolean isTenantCaseSensitive(); void setTenantCaseSensitive(boolean tenantCaseSensitive); void setProfileAttributeService(ProfileAttributeService profileAttributeService); @Transactional(propagation = Propagation.REQUIRED, readOnly = false) void putTenant(ExecutionContext context, Tenant aTenant); List getSubTenantList(ExecutionContext context, Tenant parentTenant); List getSubTenantList(ExecutionContext context, String parnentTenantId); Tenant getTenant(ExecutionContext context, String tenantId); @Transactional(propagation = Propagation.REQUIRED, readOnly = false) void deleteTenant(ExecutionContext context, String tenantId); @Transactional(propagation = Propagation.REQUIRED, readOnly = false) void updateTenant(ExecutionContext context, Tenant aTenant); @Transactional(propagation = Propagation.REQUIRED) List getAllSubTenantList(ExecutionContext context, final String parentTenantId); @SuppressWarnings({"unchecked"}) @Transactional(propagation = Propagation.REQUIRED) List<String> getAllSubTenantIdList(ExecutionContext context, final String parentTenantId); int getNumberOfTenants(ExecutionContext context); Tenant getDefaultTenant(ExecutionContext context); Tenant getTenantBasedOnTenantUri(ExecutionContext context, String tenantUri); String getUserOrgIdDelimiter(); void setUserOrgIdDelimiter(String userOrgIdDelimiter); String getTenantIdBasedOnRepositoryUri(ExecutionContext context, String uri); Tenant getTenantBasedOnRepositoryUri(ExecutionContext context, String uri); boolean isMultiTenantEnvironment(ExecutionContext context); RepoTenant getPersistentTenant(String tenantId, boolean required); RepoTenant getPersistentTenantByAlias(String tenantAlias, boolean required); @Override List<RepoTenant> getPersistentTenants(List<String> tenantIds); String getUniqueTenantId(String proposedTenantId); @Transactional(propagation = Propagation.REQUIRED) String getUniqueTenantAlias(String proposedAlias); int getNumberOfUsers(ExecutionContext context, String tenantId); int getNumberOfRoles(ExecutionContext context, String tenantId); int getSubTenantsCount(ExecutionContext context, String parentTenantId, String text); List<Tenant> getSubTenants(ExecutionContext context, String parentTenantId, String text, int firstResult,
            int maxResults); Map<String, Integer> getSubTenantsCountMap(List<String> tenantIds); @Transactional(propagation = Propagation.REQUIRED, readOnly = false) void setTenantActiveTheme(ExecutionContext context, String tenantId, String themeName); @Override Map<DiagnosticAttribute, DiagnosticCallback> getDiagnosticData(); @Transactional(propagation = Propagation.REQUIRED) List<Tenant> getAllSubTenantList(ExecutionContext context, String parentTenantId, String text); @Transactional(propagation = Propagation.REQUIRED) List<Tenant> getAllSubTenantList(ExecutionContext context, String parentTenantId, String text, int depth); @Override List<Tenant> getAllSubTenantList(ExecutionContext context, String parentTenantId, String text, int depth, String sortBy);  }### Answer:
@Test public void getDiagnosticDataTest() { Map<DiagnosticAttribute, DiagnosticCallback> resultDiagnosticData = tenantService.getDiagnosticData(); assertEquals(1, resultDiagnosticData.size()); doReturn(5).when(tenantService).getSubTenantsCount(null, "organizations", null); doReturn(5).when(tenantService).getTotalTenantsCount(null); assertEquals(5, resultDiagnosticData.get(new DiagnosticAttributeImpl( DiagnosticAttributeBuilder.TOTAL_ORGANIZATIONS_COUNT, null, null)).getDiagnosticAttributeValue()); }