### Question:
GroupRequest { public SCIMResponse<PagedByIndexSearchResult<Group>> readMultipleGroups() { return resourceRequestDelegate.readMultipleResources(new GenericType<PagedByIndexSearchResult<Group>>(){}); } GroupRequest(WebTarget targetSystem, SCIMRequest scimRequest); SCIMResponse<Group> createGroup(Group group); SCIMResponse<Group> readSingleGroup(String id); SCIMResponse<PagedByIndexSearchResult<Group>> readAllGroups(); SCIMResponse<PagedByIndexSearchResult<Group>> readAllGroups(String filter); SCIMResponse<PagedByIndexSearchResult<Group>> readMultipleGroups(); SCIMResponse<PagedByIndexSearchResult<Group>> readMultipleGroups(String filter); SCIMResponse<PagedByIdentitySearchResult<Group>> readMultipleGroups(IdentityPageQuery identityPageQuery); SCIMResponse<PagedByIdentitySearchResult<Group>> readMultipleGroups(IdentityPageQuery identityPageQuery, String filter); SCIMResponse<PagedByIndexSearchResult<Group>> readMultipleGroups(IndexPageQuery indexPageQuery); SCIMResponse<PagedByIndexSearchResult<Group>> readMultipleGroups(IndexPageQuery indexPageQuery, String filter); SCIMResponse<PagedByIndexSearchResult<Group>> readMultipleGroupsWithoutPaging(); SCIMResponse<PagedByIndexSearchResult<Group>> readMultipleGroupsWithoutPaging(String filter); SCIMResponse<PagedByIndexSearchResult<Group>> readMultipleGroupsIndexed(Response response); SCIMResponse<Group> updateGroup(Group group); SCIMResponse<Void> patchGroup(PatchBody patchBody, String groupId); SCIMResponse<Void> deleteGroup(String groupId);  }### Answer:
@Test public void testReadGroupsWithPagedByIdentityResponse() throws IOException { JsonNode jsonResponse = readResponseGroupsAsJsonNodeFromFile("read_groups_identity_paging.json"); String startId = "aaaa"; wireMockServer.stubFor(get(urlEqualTo(String.format("/Groups?startId=%s&count=100", startId))).willReturn(configureMockedResponse(OK, jsonResponse))); SCIMResponse<PagedByIdentitySearchResult<Group>> resp = SCIMClientService.builder(DEFAULT_URL) .build() .buildGroupRequest() .readMultipleGroups(identityPageQuery().withStartId(startId).withCount(100)); PagedByIdentitySearchResult<Group> receivedResponse = resp.get(); assertAll( () -> assertAll(getPagedByIdentityResponseAssertions(receivedResponse)), () -> { Group group = receivedResponse.getResources().stream().findAny().orElseThrow(RuntimeException::new); assertAll("Common resourceAttributes", getCommonResourceAssertions(group, Group.SCHEMA)); assertNotNull(group.getDisplayName()); } ); }
@TestFactory public Collection<DynamicTest> testReadGroupsWithIndexPagedResponse() { return Arrays.asList( dynamicTest("read All Groups", getGroupsIndexPagingExecutable("/Groups?startIndex=1&count=100", GroupRequest::readAllGroups)), dynamicTest("read multiple Groups default index paging", getGroupsIndexPagingExecutable("/Groups?startIndex=1&count=100", GroupRequest::readMultipleGroups)), dynamicTest("read multiple Groups custom index paging", getGroupsIndexPagingExecutable("/Groups?startIndex=3&count=40", scimGroupRequest -> scimGroupRequest.readMultipleGroups(indexPageQuery().withStartIndex(3).withCount(40)))), dynamicTest("read multiple Groups without adding page parameters", getGroupsIndexPagingExecutable("/Groups", GroupRequest::readMultipleGroupsWithoutPaging)) ); }