code: private static Method findGetterWithCompatibleReturnType(final String getterName, final Class<?> clazz,
  		final boolean enforceBooleanReturnType) {
  		
  		for( final Method method : clazz.getMethods() ) {
  			
  			if( !getterName.equalsIgnoreCase(method.getName()) || method.getParameterTypes().length != 0
  				|| method.getReturnType().equals(void.class) ) {
  				continue; // getter must have correct name, 0 parameters and a return type
  			}
  			
  			if( !enforceBooleanReturnType || boolean.class.equals(method.getReturnType())
  				|| Boolean.class.equals(method.getReturnType()) ) {
  				return method;
  			}
  			
  		}
  		
  		return null;
  	}
docs: Helper method for findGetter() that finds a getter with the supplied name, optionally enforcing that the method
  must have a Boolean/boolean return type. Developer note: this method could have accepted an actual return type to
  enforce, but it was more efficient to cater for only Booleans (as they're the only type that has differently
  named getters).
  
  @param getterName
  the getter name
  @param clazz
  the class
  @param enforceBooleanReturnType
  if true, the method must return a Boolean/boolean, otherwise it's return type doesn't matter
  @return the getter, or null if none is found