### Question:
RecipientIdentityResolver { public Object resolveRecipientObject(RecipientIdentity recipientIdentity) { Class<?> clazz = recipientIdentity.getRecipientClass(); String id = recipientIdentity.getId(); Object res = null; if (Role.class.equals(clazz)) { res = userAuthorityService.getRole(null, id); } if (User.class.equals(clazz)) { res = userAuthorityService.getUser(null, id); } if (Tenant.class.equals(clazz)) { res = tenantService.getTenant(null, id); } if (res == null) { throw new ResourceNotFoundException(id); } return res; }  Class<?> getClassForProtocol(String protocol); String getProtocolForClass(Class<?> clazz); RecipientIdentity toIdentity(String uri); RecipientIdentity toIdentity(Object recipient); String toRecipientUri(Object recipient); String toRecipientUri(RecipientIdentity recipientIdentity); Object resolveRecipientObject(RecipientIdentity recipientIdentity); Object resolveRecipientObject(String uri); void setMap(Map<String, Class<?>> map); void setIdentifierLabel(String identifierLabel); void setRequiredProtocols(Set<String> requiredProtocols);  }### Answer:
@Test(expectedExceptions = ResourceNotFoundException.class) public void resolveRecipientObject_forFolder_exception() { RecipientIdentity folderIdentity = new RecipientIdentity(Folder.class, "nonExistentFolder"); permissionsResolver.resolveRecipientObject(folderIdentity); }