### Question:
FullSyncIdentityConnector implements IdentityConnector { @Override public void traverse() throws IOException, InterruptedException { if (identitySyncType.syncUsers) { traverseUsers(); } else { logger.log( Level.INFO, "Connector is not configured to sync users. IdentitySyncType is [{0}]", identitySyncType); } if (identitySyncType.syncGroups) { traverseGroups(); } else { logger.log( Level.INFO, "Connector is not configured to sync Groups. IdentitySyncType is [{0}]", identitySyncType); } } FullSyncIdentityConnector(Repository identityRepository);  FullSyncIdentityConnector(
      Repository identityRepository, IdentityStateLoader identityStateLoader); @VisibleForTesting  FullSyncIdentityConnector(
      Repository identityRepository,
      IdentityStateLoader identityStateLoader,
      StateManager stateManager); @Override void init(IdentityConnectorContext context); @Override void traverse(); @Override void saveCheckpoint(boolean isShutdown); @Override void destroy();  }### Answer:
@Test public void testTraverse() throws Exception { initConfig(new Properties()); when(mockIdentityService.listGroups(identitySourceConfiguration.getGroupNamespace())) .thenReturn(Collections.emptyList()); when(mockIdentityService.listUsers(identitySourceConfiguration.getIdentitySourceSchema())) .thenReturn(Collections.emptyList()); StateManager stateManager = spy(new StateManagerImpl()); doAnswer( invocation -> { Iterable<IdentityUser> users = invocation.getArgument(0); Iterables.size(users); return null; }) .when(stateManager) .syncAllUsers(usersCaptor.capture(), eq(mockIdentityService), any()); doAnswer( invocation -> { Iterable<IdentityGroup> groups = invocation.getArgument(0); Iterables.size(groups); return null; }) .when(stateManager) .syncAllGroups(groupsCaptor.capture(), eq(mockIdentityService), any()); TestIdentityRepository identityRepository = spy( new TestIdentityRepository.Builder("mydomain.com") .addUserPage("", "next", false, Collections.singletonList("user1")) .addGroupPage("", "", false, Collections.singletonList("group1")) .build()); IdentityConnector connector = new FullSyncIdentityConnector(identityRepository, null, stateManager); connector.init(mockConnectorContext); connector.traverse(); assertTrue( Iterables.elementsEqual(identityRepository.getAllUsersList(), usersCaptor.getValue())); assertTrue( Iterables.elementsEqual(identityRepository.getAllGroupsList(), groupsCaptor.getValue())); assertTrue(identityRepository.allGroupPagesClosed()); connector.destroy(); verify(stateManager).close(); verify(identityRepository).close(); }