### Question:
RoleAccessUrisResolver implements Serializable { public List<UriDescriptor> getRestrictedUris() { List<UriDescriptor> restrictedUris = new ArrayList<UriDescriptor>(); for (RoleAccessUris roleAccessUris : roleAccessUrisList) { if (!hasRole(roleAccessUris)) { restrictedUris.addAll(roleAccessUris.getUris()); } } return restrictedUris; }  void setRoleAccessUrisList(List<RoleAccessUris> roleAccessUrisList); List<UriDescriptor> getRestrictedUris(); String getAbsoluteUri(String path);  }### Answer:
@Test void getRestrictedUris_alreadyHasRole_emptyuriDescriptorsList() { doReturn(ROLE_NAME).when(role).getRoleName(); doReturn(ROLE_NAME_2).when(role2).getRoleName(); List<UriDescriptor> result = objectUnderTest.getRestrictedUris(); assertEquals(emptyList(), result); }
@Test void getRestrictedUris_doesNotHaveRole_uriDescriptorsList() { List<UriDescriptor> expected = new ArrayList<UriDescriptor>(URI_DESCRIPTOR_LIST); expected.addAll(URI_DESCRIPTOR_LIST_2); doReturn(ROLE_NAME_3).when(role).getRoleName(); doReturn(ROLE_NAME_4).when(role2).getRoleName(); List<UriDescriptor> result = objectUnderTest.getRestrictedUris(); assertEquals(expected, result); }