### Question:
GroupTemplate extends AbstractYammerOperations implements GroupOperations { public List<Group> getGroups(int page, Character letter, String sortBy, boolean reverse) { MultiValueMap<String, String> params = new LinkedMultiValueMap<String, String>(); params.set("page", String.valueOf(page)); if(sortBy!=null){ params.set("sort_by", sortBy); } params.set("reverse", String.valueOf(reverse)); if(letter!=null){ params.set("letter", String.valueOf(letter)); } return restTemplate.getForObject(buildUri("groups.json", params), GroupList.class); } GroupTemplate(RestTemplate restTemplate); List<Group> getGroups(int page, Character letter, String sortBy, boolean reverse); Group getGroup(long groupId); void createGroup(String name, boolean isPrivate); void updateGroup(long groupId, String name, boolean isPrivate); void joinGroup(long groupId); void leaveGroup(long groupId);  }### Answer:
@Test public void testGetGroups_withNullParams(){ mockServer.expect(requestTo("https: .andExpect(method(GET)) .andRespond(withSuccess(jsonResource("testdata/yammer-groups"), APPLICATION_JSON)); List<Group> groups = yammerTemplate.groupOperations().getGroups(1,null,null,false); assertThat(groups.get(0).getFullName(), equalTo("yammer-test-group")); assertThat(groups.get(0).getLastMessageAt(), notNullValue()); }
@Test public void testGetGroups_withAllParams(){ mockServer.expect(requestTo("https: .andExpect(method(GET)) .andRespond(withSuccess(jsonResource("testdata/yammer-groups"), APPLICATION_JSON)); List<Group> groups = yammerTemplate.groupOperations().getGroups(1, 'A', GroupOperations.SORT_BY_PRIVACY, true); assertThat(groups.get(0).getFullName(), equalTo("yammer-test-group")); }