@Test
public void testGenerateServiceIdentityList() {

    // null service case
    ServiceIdentityList svcList = zts.generateServiceIdentityList("coretech", null);
    assertNull(svcList.getNames());
    // empty service case
    List<com.yahoo.athenz.zms.ServiceIdentity> services = new ArrayList<>();
    svcList = zts.generateServiceIdentityList("coretech", services);
    assertEquals(svcList.getNames().size(), 0);
    // no match of domain name
    ServiceIdentity svc = new ServiceIdentity().setName("athenz.storage");
    services.add(svc);
    svcList = zts.generateServiceIdentityList("coretech", services);
    assertEquals(svcList.getNames().size(), 0);
    // single entry in list
    svc = new ServiceIdentity().setName("coretech.storage");
    services.add(svc);
    svcList = zts.generateServiceIdentityList("coretech", services);
    assertEquals(svcList.getNames().size(), 1);
    assertEquals(svcList.getNames().get(0), "storage");
    // two entries in the list
    svc = new ServiceIdentity().setName("coretech.api");
    services.add(svc);
    svcList = zts.generateServiceIdentityList("coretech", services);
    assertEquals(svcList.getNames().size(), 2);
    assertEquals(svcList.getNames().get(0), "storage");
    assertEquals(svcList.getNames().get(1), "api");
}