@Test
public void testDetermineTokenTimeoutWithMultipleRoles() {

    DataCache data = new DataCache();
    Role role1 = new Role().setName("athenz:role.readers").setTokenExpiryMins(9);
    Role role2 = new Role().setName("athenz:role.writers").setTokenExpiryMins(10);
    data.processRole(role1);
    data.processRole(role2);
    DomainData domainData = new DomainData().setTokenExpiryMins(25);
    data.setDomainData(domainData);
    Set<String> roles = new HashSet<>();
    roles.add("readers");
    roles.add("writers");
    assertEquals(zts.determineTokenTimeout(data, roles, null, 1200), 540);
    assertEquals(zts.determineTokenTimeout(data, roles, null, 500), 500);
    assertEquals(zts.determineTokenTimeout(data, roles, null, null), 540);
}