### Question:
SAML2MetaUtils { public static String getMetaAliasByUri(String uri) { if (uri == null) { return null; } final int index = uri.indexOf(SAML2MetaManager.NAME_META_ALIAS_IN_URI); final int marker = index + SAML2MetaManager.NAME_META_ALIAS_IN_URI.length(); if (index == -1 || marker == uri.length()) { return null; } return uri.substring(marker); } private  SAML2MetaUtils(); static JAXBContext getMetaJAXBContext(); static Object convertStringToJAXB(String str); static Object convertInputStreamToJAXB(InputStream is); static Object convertNodeToJAXB(Node node); static String convertJAXBToString(Object jaxbObj); static void convertJAXBToOutputStream(Object jaxbObj,
                                                 OutputStream os); static Map<String, List<String>> getAttributes(BaseConfigType config); static String getRealmByMetaAlias(String metaAlias); static String getMetaAliasByUri(String uri); static XACMLPDPDescriptorElement getPolicyDecisionPointDescriptor(
        EntityDescriptorElement eDescriptor); static XACMLAuthzDecisionQueryDescriptorElement getPolicyEnforcementPointDescriptor(
        EntityDescriptorElement eDescriptor); static SPSSODescriptorElement getSPSSODescriptor(
        EntityDescriptorElement eDescriptor); static IDPSSODescriptorElement getIDPSSODescriptor(
        EntityDescriptorElement eDescriptor); static AttributeAuthorityDescriptorElement getAttributeAuthorityDescriptor(EntityDescriptorElement eDescriptor); static AttributeQueryDescriptorElement getAttributeQueryDescriptor(EntityDescriptorElement eDescriptor); static AuthnAuthorityDescriptorElement getAuthnAuthorityDescriptor(EntityDescriptorElement eDescriptor); static String getFirstEntry(Map attrMap, String key); static void fillEntriesInSet(Map attrMap, String key, String value); static SPSSOConfigElement getSPSSOConfig(EntityConfigElement eConfig); static IDPSSOConfigElement getIDPSSOConfig(
        EntityConfigElement eConfig); static String exportStandardMeta(String realm, String entityID,
	boolean sign); static EntityDescriptorElement getEntityDescriptorElement(String metadata); static List<String> importSAML2Document(SAML2MetaManager metaManager,
            String realm, Document doc); static Debug debug; }### Answer:
@Test public void testGetMetaDataByURI_DefaultRealm() { final String uri = PREFIX + PATH_SEPARATOR + SAML2MetaManager.NAME_META_ALIAS_IN_URI + PATH_SEPARATOR + TEST_ENTITY; final String result = SAML2MetaUtils.getMetaAliasByUri(uri); assertEquals(result, PATH_SEPARATOR + TEST_ENTITY); }
@Test public void testGetMetaDataByURI_SubRealm() { final String uri = PREFIX + PATH_SEPARATOR + SAML2MetaManager.NAME_META_ALIAS_IN_URI + PATH_SEPARATOR + TEST_SUB_REALM + PATH_SEPARATOR + TEST_ENTITY; final String result = SAML2MetaUtils.getMetaAliasByUri(uri); assertEquals(result, PATH_SEPARATOR + TEST_SUB_REALM + PATH_SEPARATOR + TEST_ENTITY); }