### Question:
GroupsServiceImpl extends BaseApiService<CloudIdentity> implements GroupsService { public static GroupsServiceImpl fromConfiguration(CredentialFactory credentialFactory) throws GeneralSecurityException, IOException { checkState(Configuration.isInitialized(), "configuration not initialized"); return new GroupsServiceImpl.Builder() .setCredentialFactory(credentialFactory) .setBatchPolicy(BatchPolicy.fromConfiguration()) .setRetryPolicy(RetryPolicy.fromConfiguration()) .setProxy(GoogleProxy.fromConfiguration()) .build(); } private  GroupsServiceImpl(Builder builder); @Override ListenableFuture<Operation> createGroup(Group group); @Override ListenableFuture<Group> getGroup(String groupId); @Override ListenableFuture<Operation> deleteGroup(String groupId); @Override ListenableFuture<Operation> createMembership(String groupId, Membership member); @Override ListenableFuture<Membership> getMembership(String memberId); @Override ListenableFuture<Operation> deleteMembership(String memberId); @Override Iterable<Group> listGroups(String groupNamespace); @Override Iterable<Membership> listMembers(String groupId); static GroupsServiceImpl fromConfiguration(CredentialFactory credentialFactory);  }### Answer:
@Test public void testFromConfiguration() throws GeneralSecurityException, IOException { GroupsServiceImpl.fromConfiguration(credentialFactory); }
@Test public void testBuilder() throws GeneralSecurityException, IOException { new GroupsServiceImpl.Builder() .setCredentialFactory(credentialFactory) .setBatchPolicy(BatchPolicy.fromConfiguration()) .build(); }
@Test public void testBuilderNullCredentialFactory() throws GeneralSecurityException, IOException { thrown.expect(IllegalArgumentException.class); new GroupsServiceImpl.Builder() .setBatchPolicy(BatchPolicy.fromConfiguration()) .build(); }
@Test public void testStartAndStop() throws GeneralSecurityException, IOException { BatchRequestService batchRequestService = new BatchRequestService.Builder(service) .setGoogleCredential(credentialFactory.getCredential(Collections.emptyList())) .build(); GroupsServiceImpl groupService = new GroupsServiceImpl.Builder() .setBatchRequestService(batchRequestService) .setCredentialFactory(credentialFactory) .setBatchPolicy(BatchPolicy.fromConfiguration()) .build(); groupService.startAsync().awaitRunning(); assertTrue(batchRequestService.isRunning()); groupService.stopAsync().awaitTerminated(); assertEquals(State.TERMINATED, batchRequestService.state()); }