public RegexPropertyNameConstraint(String regex) {
pattern = Pattern.compile(regex);
}
public boolean isSatisfiedBy(IMockInvocation invocation) {
IMockMethod method = invocation.getMethod();
String propertyName = GroovyRuntimeUtil.getterMethodToPropertyName(
method.getName(), method.getParameterTypes(), method.getReturnType());
return propertyName != null && pattern.matcher(propertyName).matches();
}