### Question:
KeyUtil { public static KeyDescriptorType getKeyDescriptor( RoleDescriptorType roled, String usage ) { final List<KeyDescriptorType> keyDescriptors = getKeyDescriptors(roled, usage); return CollectionUtils.getFirstItem(keyDescriptors, null); } private  KeyUtil(); static KeyProvider getKeyProviderInstance(); static String getSigningCertAlias(BaseConfigType baseConfig); static Set<PrivateKey> getDecryptionKeys(String realm, String entityID, String role); static Set<PrivateKey> getDecryptionKeys(BaseConfigType baseConfig); static PrivateKey getDecryptionKey(BaseConfigType baseConfig); static Set<X509Certificate> getVerificationCerts(RoleDescriptorType roleDescriptor, String entityID,
            String role); static EncInfo getEncInfo(
        RoleDescriptorType roled,
        String entityID,
        String role
    ); static List<KeyDescriptorType> getKeyDescriptors(RoleDescriptorType roleDescriptor, String usage); static KeyDescriptorType getKeyDescriptor(
        RoleDescriptorType roled,
        String usage
    ); static java.security.cert.X509Certificate getCert(
        KeyDescriptorType kd
    ); static Set<X509Certificate> getPEPVerificationCerts(XACMLAuthzDecisionQueryDescriptorElement pepDescriptor,
            String entityID); static EncInfo getPEPEncInfo(
       XACMLAuthzDecisionQueryDescriptorElement pepDesc,String pepEntityID); static Set<X509Certificate> getPDPVerificationCerts(XACMLPDPDescriptorElement pdpDescriptor,
            String entityID); static void clear();  }### Answer:
@Test public void testNoUseKeyDescriptorEntityDescriptor() throws SAML2MetaException, JAXBException { String idpMetadata = XMLUtils.print( XMLUtils.toDOMDocument(ClassLoader.getSystemResourceAsStream(XML_DOCUMENT_TO_LOAD), SAML2Utils.debug), "UTF-8"); EntityDescriptorElement element = SAML2MetaUtils.getEntityDescriptorElement(idpMetadata); List descriptors = element.getRoleDescriptorOrIDPSSODescriptorOrSPSSODescriptor(); for (Object descriptor : descriptors) { if (descriptor instanceof IDPSSODescriptorElement) { KeyDescriptorType type = KeyUtil.getKeyDescriptor((IDPSSODescriptorElement)descriptor, "signing"); Assert.assertNotNull(type); break; } } }