class SubjectMatterExpertServiceImpl implements SubjectMatterExpertService {

    @Override
    public SubjectMatterExpert getSubjectMatterExpert(SubjectMatterExpertKey subjectMatterExpertKey)
    {
        // Validate and trim the subject matter expert key.
        validateSubjectMatterExpertKey(subjectMatterExpertKey);

        // Get the information for the subject matter expert.
        SubjectMatterExpertContactDetails subjectMatterExpertContactDetails = subjectMatterExpertDao.getSubjectMatterExpertByKey(subjectMatterExpertKey);
        if (subjectMatterExpertContactDetails == null)
        {
            throw new ObjectNotFoundException(
                String.format("The subject matter expert with user id \"%s\" does not exist.", subjectMatterExpertKey.getUserId()));
        }

        // Create and return the subject matter expert.
        return new SubjectMatterExpert(subjectMatterExpertKey, subjectMatterExpertContactDetails);
    }

}