### Question:
ProfileEntryEngineClient { public SearchResult<ProfileEntry> searchProfiles(final SearchOptions options) { try { return profileApi.searchProfileEntries(options); } catch (final InvalidSessionException e) { throw new APISessionInvalidException(e); } catch (final SearchException e) { throw new APIException(e); } } protected  ProfileEntryEngineClient(final ProfileAPI profileApi); ProfileEntry getProfileEntry(final Long id); SearchResult<ProfileEntry> searchProfiles(final SearchOptions options); List<ProfileEntry> getProfileEntriesByProfile(final Long profileId); List<ProfileEntry> getAllChildsOfAProfileEntry(final Long id);  }### Answer:
@Test public void searchProfileEntries_call_engine_and_get_specific_results() throws SearchException { SearchOptions searchOptions = new SearchOptionsBuilder(0, 10).done(); engineClient.searchProfiles(searchOptions); verify(profileAPI).searchProfileEntries(searchOptions); }
@Test(expected = APIException.class) public void searchProfileEntries_call_engine_and_raise_Search_Exception_because_of_invalid_options() throws SearchException { SearchOptions searchOptions = new SearchOptionsBuilder(-1, 10).done(); doThrow(new APIException("Search options invalid")).when(profileAPI).searchProfileEntries(searchOptions); engineClient.searchProfiles(searchOptions); }