class AssignValueImplementer implements RuleActionApplier {

    @Override
    public TrackerBundle executeActions( TrackerBundle bundle )
    {
        Map<String, List<RuleEffect>> enrollmentEffects = getEffects( bundle.getEnrollmentRuleEffects() );

        enrollmentEffects
            .entrySet()
            .stream()
            .forEach( e -> getTrackedEntityFromEnrollment( bundle, e.getKey() )
                .ifPresent( tei -> setTeiAttribute( tei, e.getValue() ) ) );

        Map<String, List<RuleEffect>> eventEffects = getEffects( bundle.getEventRuleEffects() );

        eventEffects
            .entrySet()
            .stream()
            .forEach( e -> getEvent( bundle, e.getKey() )
                .ifPresent( tei -> setDataElement( tei, e.getValue() ) ) );

        return bundle;
    }

}