### Question:
TokenProfileProvider implements UserRightsBuilder.TokenProvider { @Override public List<String> getTokens() { return tokens; } TokenProfileProvider(List<Profile> profiles, ProfileEntryEngineClient client); @Override List<String> getTokens();  }### Answer:
@Test public void should_return_all_page_tokens_for_each_profile_entries() throws Exception { given(entry1.getPage()).willReturn("token 1"); given(entry2.getPage()).willReturn("token 2"); TokenProfileProvider provider = new TokenProfileProvider(Arrays.asList( profile1, profile2), client); assertThat(provider.getTokens().toString()).isEqualTo("[token 1, token 2]"); }
@Test public void should_not_return_a_token_if_the_page_from_the_profile_entry_is_null() throws Exception { given(entry1.getPage()).willReturn(null); given(entry2.getPage()).willReturn("token 2"); TokenProfileProvider provider = new TokenProfileProvider(Arrays.asList( profile1, profile2), client); assertThat(provider.getTokens().toString()).isEqualTo("[token 2]"); }