### Question:
GroupsServiceImpl extends BaseApiService<CloudIdentity> implements GroupsService { @Override public ListenableFuture<Operation> createGroup(Group group) throws IOException { Groups.Create create = service.groups().create(checkNotNull(group)); return batchRequest(create, retryPolicy, batchService); } 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 testCreateGroup() throws Exception { Group groupToCreate = new Group().setGroupKey(new EntityKey().setNamespace("ns").setId("group1")); Groups.Create request = mock(Groups.Create.class); when(groups.create(groupToCreate)).thenReturn(request); Operation operation = new Operation().setDone(true); doAnswer( invocation -> { AsyncRequest<Operation> input = invocation.getArgument(0); setAsyncRequestResponse(input, operation); return null; }) .when(batchRequestService) .add(any()); ListenableFuture<Operation> group = groupsService.createGroup(groupToCreate); assertEquals(operation, group.get()); }