Over simplistic helper to compare two strings to check radio buttons.

@param value1 the first value
@param value2 the second value
@return "checked" if both values are equal, the empty String "" otherwise
356814
public String isChecked(String value1, String value2) {

        if ((value1 == null) || (value2 == null)) {
            return "";
        }

        if (value1.trim().equalsIgnoreCase(value2.trim())) {
            return "checked";
        }

        return "";
    }
473567
public static <T> T check(T value, T elseValue, IChecker checker) {
        return check(value, elseValue, checker.check());
    }
919598
public int compare(final SnomedConcept o1, final SnomedConcept o2) {
        if (o1 == o2) return 0;
        if (o1 != null) {
            if (o2 == null) return 1;
            else return o1.candidatePreferred.compareTo(o2.candidatePreferred);
        }
        return -1;
    }
1039939
@Pure
	public static boolean epsilonEqualsDistance(double value1, double value2) {
		return value1 >= (value2 - distancePrecision) && value1 <= (value2 + distancePrecision);
	}
96099
def match(value1, value2):
        
        if value1 == None and value2 == None:
            return True
        if value1 == None or value2 == None:
            return False

        string1 = str(value1)
        string2 = str(value2)
        return re.match(string2, string1) != None
1160924
private boolean isMatchingString(String value1, String value2) {
        
        boolean valuesMatch = true;
        
        if (value1 == null) {
            if (value2 != null) {
                valuesMatch = false;
            }
        } else { 
            valuesMatch = value1.equals(value2);
        }
        
        return valuesMatch;
    }
955445
public int compare(final SnomedConcept o1, final SnomedConcept o2) {
        if (o1 == o2) return 0;
        if (o1 != null) {
            if (o2 == null) return 1;
            else return o1.phraseText.compareTo(o2.phraseText);
        }
        return -1;
    }
251055
public static boolean equal(String str1, String str2) {
		return str1 != null && str2 != null && str1.equals(str2);
	}
180103
@Override
  public int compare(String s1, String s2) {
    if (s1 == s2) { // NOSONAR false-positive: Compare Objects With Equals
      return 0;
    }
    int h1 = s1.hashCode();
    int h2 = s2.hashCode();
    if (h1 < h2) {
      return -1;
    } else if (h1 > h2) {
      return 1;
    } else {
      return s1.compareTo(s2);
    }
  }
268196
private boolean isEqual(String str1, String str2) {
		if (StringUtils.isEmpty(str1) && StringUtils.isEmpty(str2)) {
			return true;
		} else if (!StringUtils.isEmpty(str1)) {
			return str1.equals(str2);
		} else {
			return false;
		}
	}
800519
@SuppressWarnings({ "unchecked" })
	protected int compare(E k1, E k2) {
		if (comparator == null) {
			return ((Comparable) k1).compareTo(k2);
		}
		return comparator.compare(k1, k2);
	}
144004
public static function compare($value1, $value2)
    {
        if (self::isIntlLoaded()) {
            return self::getCollator()->compare($value1, $value2);
        }
        
        return strnatcmp($value1, $value2);
    }
455899
@Override
    public int compare(String o1, String o2) {
        if (C_ELEMENT_SYMBOL.equals(o1)) {
            if (C_ELEMENT_SYMBOL.equals(o2)) {
                return 0;
            } else {
                return -1;
            }
        } else if (H_ELEMENT_SYMBOL.equals(o1)) {
            if (C_ELEMENT_SYMBOL.equals(o2)) {
                return 1;
            } else if (H_ELEMENT_SYMBOL.equals(o2)) {
                return 0;
            } else {
                return -1;
            }
        } else {
            if (C_ELEMENT_SYMBOL.equals(o2) || H_ELEMENT_SYMBOL.equals(o2)) {
                return 1;
            } else {
                return ((String) o1).compareTo((String) o2);
            }
        }
    }
686698
@Override
    public void setValue(Object value) throws WidgetException {
        try {
            if (value instanceof String) {
                boolean selected = false;
                List<WebElement> elements = findElements();
                for (WebElement we : elements) {
                    if (we.getAttribute("value").equals(value)) {
                        we.click();
                        selected = true;
                        break;
                    }
                }

                if (!selected)
                    throw new WidgetException("Could not find desired option to select",
                            getLocator());
            } else {
                throw new WidgetException("Invalid type. 'value' must be a 'String' type of desired option to select",
                        getLocator());
            }
        } catch (Exception e) {
            throw new WidgetException("Error while selecting option on radio group", getLocator(),
                    e);
        }
    }
125381
def are_equal(value1, value2):
        
        if value1 == None or value2 == None:
            return True
        if value1 == None or value2 == None:
            return False
        return value1 == value2
1296722
public SeleniumAssert isEqualTo(String value) {
        Strings.instance().assertMatches(info, (String) actual, value);
        return this;
    }
666935
public Slider setValues(Integer value1, Integer value2)
	{
		if (value1 != null && value2 != null)
		{
			ArrayItemOptions<IntegerItemOptions> options =
				new ArrayItemOptions<IntegerItemOptions>();
			options.add(new IntegerItemOptions(value1));
			options.add(new IntegerItemOptions(value2));
			this.options.put("values", options);
		}
		return this;
	}