final Set<NonAffiliatedTeacher> nonAffiliatedTeachers = new HashSet<NonAffiliatedTeacher>(); for (final NonAffiliatedTeacher nonAffiliatedTeacher : RootDomainObject.getInstance().getNonAffiliatedTeachersSet()) { if (nonAffiliatedTeacher.getName().equalsIgnoreCase(name)) { nonAffiliatedTeachers.add(nonAffiliatedTeacher); } } return nonAffiliatedTeachers; }
Pattern pattern = Pattern.compile(name.toLowerCase());  final Set<NonAffiliatedTeacher> nonAffiliatedTeachers = new HashSet<NonAffiliatedTeacher>(); for (final NonAffiliatedTeacher nonAffiliatedTeacher : RootDomainObject.getInstance() .getNonAffiliatedTeachersSet()) { Matcher matcher = pattern.matcher(nonAffiliatedTeacher.getName().toLowerCase()); if (matcher.find()) { nonAffiliatedTeachers.add(nonAffiliatedTeacher); } } return nonAffiliatedTeachers; }
	public static Set<NonAffiliatedTeacher> findNonAffiliatedTeacherByName(final String name) {		final Set<NonAffiliatedTeacher> nonAffiliatedTeachers = new HashSet<NonAffiliatedTeacher>();		for (final NonAffiliatedTeacher nonAffiliatedTeacher : RootDomainObject.getInstance().getNonAffiliatedTeachersSet()) {			if (nonAffiliatedTeacher.getName().equalsIgnoreCase(name)) {				nonAffiliatedTeachers.add(nonAffiliatedTeacher);			}		}		return nonAffiliatedTeachers;	}