@Test
public void testValidateSanIp() {

    InstanceZTSProvider provider = new InstanceZTSProvider();
    provider.initialize("provider", "com.yahoo.athenz.instance.provider.impl.InstanceZTSProvider", null, null);
    assertTrue(provider.validateSanIp(new String[]{"10.1.1.1"}, "10.1.1.1"));
    assertTrue(provider.validateSanIp(null, "10.1.1.1"));
    assertTrue(provider.validateSanIp(new String[]{}, "10.1.1.1"));
    assertFalse(provider.validateSanIp(new String[]{""}, "10.1.1.1"));
    assertFalse(provider.validateSanIp(new String[]{"10.1.1.2"}, "10.1.1.1"));
    assertFalse(provider.validateSanIp(new String[]{"10.1.1.2"}, null));
    assertFalse(provider.validateSanIp(new String[]{"10.1.1.2"}, ""));
    // ipv6
    assertTrue(provider.validateSanIp(new String[]{"2001:db8:a0b:12f0:0:0:0:1"}, "2001:db8:a0b:12f0:0:0:0:1"));
    assertTrue(provider.validateSanIp(null, "2001:db8:a0b:12f0:0:0:0:1"));
    assertTrue(provider.validateSanIp(new String[]{}, "2001:db8:a0b:12f0:0:0:0:1"));
    assertFalse(provider.validateSanIp(new String[]{"2002:db9:a0b:12f0:0:0:0:1"}, "2001:db8:a0b:12f0:0:0:0:1"));
    assertFalse(provider.validateSanIp(new String[]{"2002:db9:a0b:12f0:0:0:0:1"}, "10.1.1.1"));
    assertFalse(provider.validateSanIp(new String[]{"2002:db9:a0b:12f0:0:0:0:1"}, null));
    assertFalse(provider.validateSanIp(new String[]{"2002:db9:a0b:12f0:0:0:0:1"}, ""));
    // ipv4 and ipv6 mixed
    assertTrue(provider.validateSanIp(new String[]{"10.1.1.1", "2001:db8:a0b:12f0:0:0:0:1"}, "10.1.1.1"));
    assertTrue(provider.validateSanIp(new String[]{"10.1.1.1", "2001:db8:a0b:12f0:0:0:0:1"}, "2001:db8:a0b:12f0:0:0:0:1"));
    assertFalse(provider.validateSanIp(new String[]{"10.1.1.1", "2001:db8:a0b:12f0:0:0:0:1"}, "10.1.1.2"));
    assertFalse(provider.validateSanIp(new String[]{"10.1.1.1", "2001:db8:a0b:12f0:0:0:0:1"}, null));
    assertFalse(provider.validateSanIp(new String[]{"10.1.1.1", "2001:db8:a0b:12f0:0:0:0:1"}, ""));
    provider.close();
}