Iterate through the options to determine if an option exists allowing for Option/Code and Legacy matching.

@param options the list of options
@param data the test data value
@return true if the list of options contains the option
778774
public static boolean containsOptionWithMatching(final List<?> options, final Object data) {
		if (options != null) {
			for (Object option : options) {
				if (option instanceof OptionGroup) {
					List<?> groupOptions = ((OptionGroup) option).getOptions();
					if (groupOptions != null) {
						for (Object nestedOption : groupOptions) {
							if (isEqualWithMatching(nestedOption, data)) {
								return true;
							}
						}
					}
				} else if (isEqualWithMatching(option, data)) {
					return true;
				}
			}
		}
		return false;
	}
1132905
public boolean has(String tableName) {

		boolean exists = has(EXTENSION_NAME, tableName,
				TileTable.COLUMN_TILE_DATA);

		return exists;
	}
1082876
@SuppressWarnings("UnusedDeclaration")
    public static boolean validOptions(String[][] options, DocErrorReporter errorReporter) {
        return validOptions(options, errorReporter, new StandardAdapter());
    }
248539
public boolean has(String value) {
		addToDefaults(value, null);
		unrequestedParameters.remove(value);
		return data.containsKey(value);
	}
1257976
@SuppressWarnings("unchecked")
	public OptionsBuilder includes(String... includes) {
		return includes != null ? includes(Arrays.asList(includes)) : this;
	}
7637
private void checkChoices(Option o, Map<String, String> data) throws RequiredParametersException {
		if (o.getChoices().size() > 0 && !o.getChoices().contains(data.get(o.getName()))) {
			throw new RequiredParametersException("Value " + data.get(o.getName()) +
					" is not in the list of valid choices for key " + o.getName());
		}
	}
110941
public boolean hasShortOption(String opt)
    {
        opt = Util.stripLeadingHyphens(opt);

        return shortOpts.containsKey(opt);
    }
141823
protected static boolean argIsOption(String arg, String option) {
        return arg.equalsIgnoreCase(option) || arg.equalsIgnoreCase('-' + option);
    }
434575
@Override
   public boolean shouldStyle(Object data, Object element) {
      for (StylingCondition sc : conditions) {
         if (!sc.shouldStyle(data, null)) {
            return false;
         }
      }
      return true;
   }
679586
@Override
	public boolean hasMoreData(final String dataSetKey) {
		if (dataSetKeys.isEmpty()) {
			// Fill set of known data set keys
			for (String constraintId : getGenerator().getConstraintIds()) {
				if (constraintId != null && constraintId.endsWith(".all")) {
					String key = StringUtils.substringBefore(constraintId, "." + GeneratorConstants.ALL_CONSTRAINT);
					dataSetKeys.add(key);
				}
			}
		}
		return dataSetKeys.contains(dataSetKey);
	}
181365
public boolean contains(final T element) {
        if (element == null) {
            return false;
        }

        return lowerEndpoint.includes(element) && upperEndpoint.includes(element);
    }
60430
public function match(array $options) {
        if (isset($options['element'])) {
            if (isset($this->data[$options['element']])) {
                if ($this->elementData == $this->data[$options['element']]) {
                    return true;
                }
            } else {
                return true;
            }
        } else if (isset($options['value'])) {
            if ($this->elementData == $options['value']) {
                return true;
            }
        }

        $this->addError($this->checkMessage('Values mismatch', $options));
        return false;
    }
1303844
@Override
  public void setOptions(String[] options) throws Exception {
    setDebug(Utils.getFlag("D", options));
    Utils.checkForRemainingOptions(options);
  }
1119449
private boolean anyStringContainsNewLine(final String[] data) {
		boolean returnVal = false;
		for (int i = 0; i < data.length; i++) {
			if (Util.containsNewlines(data[i])) {
				returnVal = true;
			}
		}
		return returnVal;
	}
389602
@Override
	public boolean containsKey(final Object key) {
		lock.readLock().lock();
		try {
			if (isKeyValid(key)) {
				final boolean useLocalPrefixes = !mixDefaultAndLocalPrefixes && hasLocalPrefixConfigurations();
				if (!properties.containsKey(getPrefixedKey(key, useLocalPrefixes))) {
					return properties.containsKey(key);
				} else {
					return true;
				}
			}
			return false;
		} finally {
			lock.readLock().unlock();
		}
	}
277924
public function validateNotSame($data, $options, $context) {
		if (!is_array($options)) {
			$options = ['compare' => $options];
		}

		$compareValue = $context['data'][$options['compare']];
		return $compareValue !== $data;
	}
766383
private Object findValidOption(final List<?> options, final Object selected,
			final boolean handleInvalid) {

		// No selection made
		if (selected == null) {
			// No Selection required, or no options to select
			if (isAllowNoSelection() || options == null || options.isEmpty()) {
				return null;
			} else { // Selection is required
				// Check if NULL is an option
				if (SelectListUtil.containsOption(options, null)) {
					return null;
				}

				// Must have a selected option
				throw new IllegalStateException(
						"A valid option must be selected for lists that require a selected option.");
			}
		}

		// Check we have a valid option and if we find it via Option/Code or Legacy matching, return the matching option
		if (options != null) {
			Object option = SelectListUtil.getOptionWithMatching(options, selected);
			if (option != null) {
				return option;
			}
		}

		// Editable with User Entered Text
		if (isEditable() && selected instanceof String) {
			return selected;
		}

		// Handle invalid option
		if (handleInvalid) {
			Object valid = doHandleInvalidOption(selected);
			setSelected(valid);
			return valid;
		} else {
			throw new IllegalStateException(
					"The selected option \"" + selected + "\" is not an available option.");
		}

	}