### Question:
GroupsServiceImpl extends BaseApiService<CloudIdentity> implements GroupsService { @Override public ListenableFuture<Operation> deleteMembership(String memberId) throws IOException { validateMemberResourceName(memberId); Memberships.Delete delete = service.groups().memberships().delete(memberId); return batchRequest(delete, 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 testDeleteMemberships() throws Exception { String memberId = "groups/g1/memberships/m1"; Memberships.Delete deleteRequest = mock(Memberships.Delete.class); when(memberships.delete(memberId)).thenReturn(deleteRequest); 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> member = groupsService.deleteMembership(memberId); assertEquals(operation, member.get()); }