### Question:
UserRightsBuilder { public List<String> build() { List<String> rights = new ArrayList<String>(); for (String token : provider.getTokens()) { rights.add(generator.getHash(token.concat(String.valueOf(session.getId())))); } return rights; } UserRightsBuilder(org.bonitasoft.engine.session.APISession session, TokenProvider provider); List<String> build();  }### Answer:
@Test public void should_build_rights_for_a_token_add_to_it() throws Exception { given(session.getId()).willReturn(56L); UserRightsBuilder builder = new UserRightsBuilder(session, new TokenListProvider(Arrays.asList( "token"))); assertEquals(builder.build().get(0), generator.getHash("token56")); }
@Test public void should_build_rights_for_all_tokens_progressively_add_to_it() throws Exception { given(session.getId()).willReturn(85L); UserRightsBuilder builder = new UserRightsBuilder(session, new TokenListProvider(Arrays.asList( "token 1", "token 2"))); List<String> rights = builder.build(); assertEquals(rights.get(0), generator.getHash("token 185")); assertEquals(rights.get(1), generator.getHash("token 285")); }