### Question:
SearchProfileMembersHelper implements DatastoreHasSearch<ProfileMemberItem> { @Override public ItemSearchResult<ProfileMemberItem> search(int page, int resultsByPage, String search, String orders, Map<String, String> filters) { SearchOptionsCreator options = makeSearchOptions(page, resultsByPage, search, orders, filters); SearchResult<ProfileMember> searchResult = profileMemberClient.searchProfileMembers(getMemberType(filters).getType(), options.create()); return new ItemSearchResultConverter<ProfileMemberItem, ProfileMember>(page, resultsByPage, searchResult, new ProfileMemberItemConverter()).toItemSearchResult(); } SearchProfileMembersHelper(ProfileMemberEngineClient profileMemberClient); @Override ItemSearchResult<ProfileMemberItem> search(int page, int resultsByPage, String search, String orders, Map<String, String> filters);  }### Answer:
@Test public void testWeCanSearchProfileMembers() throws Exception { SearchResultImpl<ProfileMember> aKnownSearchResult = aKnownSearchResult(); List<ProfileMemberItem> expectedProfileMemberItems = new ProfileMemberItemConverter().convert(aKnownSearchResult().getResult()); when(engineClient.searchProfileMembers(eq(MemberType.ROLE.getType()), any(SearchOptions.class))).thenReturn(aKnownSearchResult); HashMap<String, String> filters = filterOnProfileIdAndMemberType(5L, MemberType.ROLE); ItemSearchResult<ProfileMemberItem> searchResult = searchProfilesHelper.search(0, 10, null, null, filters); assertTrue(SearchUtils.areEquals(expectedProfileMemberItems, searchResult.getResults())); }
@Test(expected = APIFilterMandatoryException.class) public void testSearchWithoutMandatoryFiltersThrowError() { searchProfilesHelper.search(0, 10, null, null, Collections.<String, String> emptyMap()); }