@Test
public void testIsUserAuthorityFilterValid() {

    Authority mockAuthority = Mockito.mock(Authority.class);
    Mockito.when(mockAuthority.isAttributeSet("user.john", "contractor")).thenReturn(true);
    Mockito.when(mockAuthority.isAttributeSet("user.john", "employee")).thenReturn(false);
    Mockito.when(mockAuthority.isAttributeSet("user.john", "local")).thenReturn(true);
    // non-users are always false
    assertFalse(ZMSUtils.isUserAuthorityFilterValid(mockAuthority, "filterList", "athenz.test"));
    // single filter value
    assertTrue(ZMSUtils.isUserAuthorityFilterValid(mockAuthority, "contractor", "user.john"));
    assertFalse(ZMSUtils.isUserAuthorityFilterValid(mockAuthority, "employee", "user.john"));
    // multiple values
    assertTrue(ZMSUtils.isUserAuthorityFilterValid(mockAuthority, "contractor,local", "user.john"));
    assertTrue(ZMSUtils.isUserAuthorityFilterValid(mockAuthority, "local,contractor", "user.john"));
    assertFalse(ZMSUtils.isUserAuthorityFilterValid(mockAuthority, "local,contractor,employee", "user.john"));
    assertFalse(ZMSUtils.isUserAuthorityFilterValid(mockAuthority, "local,employee,contractor", "user.john"));
    assertFalse(ZMSUtils.isUserAuthorityFilterValid(mockAuthority, "employee,contractor", "user.john"));
}