public <U extends UserProfile> Optional<U> getProfile(final Class<U> clazz) {
        return (Optional<U>) getProfile();
    }
<p>getProfile.</p>

@param clazz a {@link Class} object
@param <U> a U class
@return a {@link Optional} object
pac4j-core/src/main/java/org/pac4j/core/profile/ProfileManager.java