code: public int getIndexOfValue(String fieldName, Object value) {
  		int ret = -1;
  		Object val = value;
  		if (value instanceof DomainObject)
  			val = ((DomainObject)value).getRawObject();
  		Object lst = getFieldValue(fieldName, true); // internal
  		if (lst instanceof List<?>) {
  			List<?> list = (List<?>)lst;
  			for (int i = 0; i < list.size(); i++) {
  				Object obj = list.get(i);
  				if (obj.equals(val)) {
  					ret = i;
  					break;
  				}
  			}
  		} else if (lst != null && lst.getClass().isArray()) {
  			int len = Array.getLength(lst);
  			for (int i = 0; i < len; i++) {
  				Object obj = Array.get(lst, i);
  				if (obj.equals(val)) {
  					ret = i;
  					break;
  				}
  			}
  		} else {
  			if (!getDomainObjectType().getFieldByName(fieldName).isListOrArray())
  				throw new RuntimeException("field: [" + fieldName + "] is neither list nor array");
  			if (lst == null)
  				throw new RuntimeException("list or array field: [" + fieldName + "] is null");
  		}
  		return ret;
  	}
docs: Returns the index of the first occurrence of the specified value
  in the list field, or -1 if the list field does not contain the value.
  @param fieldName
  @param value
  @return