class BaseNotificationMessageRenderer implements NotificationMessageRenderer<T> {

    public NotificationMessage render( T entity, NotificationTemplate template )
    {
        final String collatedTemplate = template.getSubjectTemplate() + " " + template.getMessageTemplate();

        Map<String, String> expressionToValueMap =
            extractExpressionsByType( collatedTemplate ).entrySet().stream()
                .map( entry -> resolveValuesFromExpressions( entry.getValue(), entry.getKey(), entity ) )
                .collect( HashMap::new, Map::putAll, Map::putAll );

        return createNotificationMessage( template, expressionToValueMap );
    }

}