@Test
public void testExtractRequestInstanceId() throws CertificateParsingException {

    assertNull(X509CertUtils.extractRequestInstanceId(null));
    X509Certificate cert = Mockito.mock(X509Certificate.class);
    Collection<List<?>> dnsNames = new ArrayList<>();
    ArrayList<Object> item1 = new ArrayList<>();
    item1.add(2);
    item1.add("host1.domain.athenz");
    dnsNames.add(item1);
    Mockito.when(cert.getSubjectAlternativeNames()).thenReturn(dnsNames);
    assertNull(X509CertUtils.extractRequestInstanceId(cert));
    ArrayList<Object> item2 = new ArrayList<>();
    item2.add(2);
    item2.add("instanceid1.instanceid.athenz.test");
    dnsNames.add(item2);
    assertEquals("instanceid1", X509CertUtils.extractRequestInstanceId(cert));
}