### Question:
UsersServiceImpl extends BaseApiService<Directory> implements UsersService { public static UsersServiceImpl fromConfiguration(CredentialFactory credentialFactory) throws GeneralSecurityException, IOException { checkState(Configuration.isInitialized(), "configuration not initialized"); return new UsersServiceImpl.Builder() .setCredentialFactory(credentialFactory) .setBatchPolicy(BatchPolicy.fromConfiguration()) .setRetryPolicy(RetryPolicy.fromConfiguration()) .setCustomer(Configuration.getString(CUSTOMER_ID_CONFIG, null).get()) .setProxy(GoogleProxy.fromConfiguration()) .build(); } private  UsersServiceImpl(Builder builder); static UsersServiceImpl fromConfiguration(CredentialFactory credentialFactory); @Override ListenableFuture<User> getUserMapping(String userId); @Override ListenableFuture<User> updateUserMapping(
      String userId, String schemaName, String attributeName, Optional<String> value); @Override Iterable<User> listUsers(String schemaName);  }### Answer:
@Test public void testFromConfiguration() throws GeneralSecurityException, IOException { UsersServiceImpl.fromConfiguration(credentialFactory); }
@Test public void testBuilder() throws GeneralSecurityException, IOException { assertNotNull( new UsersServiceImpl.Builder() .setCredentialFactory(credentialFactory) .setBatchPolicy(BatchPolicy.fromConfiguration()) .setCustomer("c1") .build()); }
@Test public void testBuilderNullCredentialFactory() throws GeneralSecurityException, IOException { thrown.expect(IllegalArgumentException.class); new UsersServiceImpl.Builder().setBatchPolicy(BatchPolicy.fromConfiguration()).build(); }
@Test public void testStartAndStop() throws GeneralSecurityException, IOException { BatchRequestService batchRequestService = new BatchRequestService.Builder(service) .setGoogleCredential(credentialFactory.getCredential(Collections.emptyList())) .build(); UsersServiceImpl usersService = new UsersServiceImpl.Builder() .setBatchRequestService(batchRequestService) .setCredentialFactory(credentialFactory) .setCustomer("c1") .setBatchPolicy(BatchPolicy.fromConfiguration()) .build(); usersService.startAsync().awaitRunning(); assertTrue(batchRequestService.isRunning()); usersService.stopAsync().awaitTerminated(); assertEquals(State.TERMINATED, batchRequestService.state()); }