### Question:
MigrationClientFactory { public static MigrationClient getClient(String migratingToVersion) { Integer index = clientLocator.get(migratingToVersion); if (index != null) { return migrationClients.get(index); } return null; }  static void initFactory(String tenants, String blackListTenants, RegistryService registryService,
            TenantManager tenantManager, boolean removeDecryptionFailedKeysFromDB); static void clearFactory(); static MigrationClient[] getAllClients(String migratingFromVersion); static MigrationClient getClient(String migratingToVersion);  }### Answer:
@Test public void testGetClient() throws Exception { RegistryService mockRegistryService = Mockito.mock(RegistryService.class); TenantManager mockTenantManager = Mockito.mock(TenantManager.class); Mockito.when(mockTenantManager.getAllTenants()).thenReturn(new Tenant[]{new Tenant()}); MigrationClientFactory.initFactory(null, null, mockRegistryService, mockTenantManager, false); MigrationClient migrateTo18Client = MigrationClientFactory.getClient(Constants.VERSION_1_8); Assert.assertEquals(migrateTo18Client, null); MigrationClient migrateTo19Client = MigrationClientFactory.getClient(Constants.VERSION_1_9); Assert.assertTrue(migrateTo19Client instanceof MigrateFrom18to19); MigrationClient migrateTo191Client = MigrationClientFactory.getClient(Constants.VERSION_1_9_1); Assert.assertTrue(migrateTo191Client instanceof MigrateFrom18to19); MigrationClient migrateTo110Client = MigrationClientFactory.getClient(Constants.VERSION_1_10); Assert.assertTrue(migrateTo110Client instanceof MigrateFrom19to110); }