@Test
public void testParseInvalidArray() {

    CertificateIdentityParser parser = new CertificateIdentityParser(null, false);
    CertificateIdentity certId = null;
    try {
        certId = parser.parse((X509Certificate[]) null);
    } catch (CertificateIdentityException e) {
        assertEquals(e.getMessage(), "No certificate available in request");
    } finally {
        assertNull(certId);
    }
    try {
        certId = parser.parse(new X509Certificate[]{ null });
    } catch (CertificateIdentityException e) {
        assertEquals(e.getMessage(), "No certificate available in request");
    } finally {
        assertNull(certId);
    }
}