Case insensitive comparison of labels of two tree items.

@param item1 First tree item.
@param item2 Second tree item.
@return Result of the comparison.
19085
private static int compare(Treenode item1, Treenode item2) {
        String label1 = item1.getLabel();
        String label2 = item2.getLabel();
        return label1 == label2 ? 0 : label1 == null ? -1 : label2 == null ? -1 : label1.compareToIgnoreCase(label2);
    }
1314487
@Override
    public <I> MatchResult<I> matchResult(I item) {
        StringDescription mismatch = new StringDescription();
        if (matches(item, mismatch)) {
            return new MatchResultSuccess<>(item, this);
        } else {
            return new MatchResultMismatch<>(item, this, mismatch.toString());
        }
    }
1365367
private float getTagScore(DependencyTree t1, DependencyTree t2){
        if(t1.pos.equals(t2.pos))
            return 1;
        else return 0;
    }
757327
public <T> void compare(Comparison comparison, Label trueLabel, Local<T> a, Local<T> b) {
        adopt(trueLabel);
        Rop rop = comparison.rop(StdTypeList.make(a.type.ropType, b.type.ropType));
        addInstruction(new PlainInsn(rop, sourcePosition, null,
                RegisterSpecList.make(a.spec(), b.spec())), trueLabel);
    }
344567
public static boolean compareStrings(String s1, String s2) {
        if (s1 == s2)
            return true;
        if (s1 != null && s2 != null && s1.equals(s2))
            return true;
        return false;
    }
1089124
protected static boolean match(Object ref, Object test) {
    if(ref == null) {
      return false;
    }
    // Cheap and fast, may hold for class labels!
    if(ref == test) {
      return true;
    }
    if(ref instanceof LabelList && test instanceof LabelList) {
      final LabelList lref = (LabelList) ref;
      final LabelList ltest = (LabelList) test;
      final int s1 = lref.size(), s2 = ltest.size();
      if(s1 == 0 || s2 == 0) {
        return false;
      }
      for(int i = 0; i < s1; i++) {
        String l1 = lref.get(i);
        if(l1 == null) {
          continue;
        }
        for(int j = 0; j < s2; j++) {
          if(l1.equals(ltest.get(j))) {
            return true;
          }
        }
      }
    }
    // Fallback to equality, e.g. on class labels
    return ref.equals(test);
  }
965196
@SuppressWarnings("rawtypes")
  @Override
	public int compare(ITuple w1, ITuple w2) {
		int schemaId1 = tupleMRConf.getSchemaIdByName(w1.getSchema().getName());
		int schemaId2 = tupleMRConf.getSchemaIdByName(w2.getSchema().getName());
		int[] indexes1 = serInfo.getGroupSchemaIndexTranslation(schemaId1);
		int[] indexes2 = serInfo.getGroupSchemaIndexTranslation(schemaId2);
	  Serializer[] serializers = serInfo.getGroupSchemaSerializers();
		return compare(w1.getSchema(), groupCriteria, w1, indexes1, w2, indexes2,serializers);
	}
1277304
public static boolean simpleNameEquals(String s1, String s2) {
		if (isNullOrEmpty(s1)) {
			return isNullOrEmpty(s2);
		}
		return s1.equals(s2);
	}
863355
public static boolean sameLists(String list1, String list2)
    {
        return new CommaListIterator(list1).equals(new CommaListIterator(list2));
    }
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;
    }
573704
function caseInsensitiveSorter(pattern1, pattern2) {
    pattern1 = pattern1.toLowerCase();
    pattern2 = pattern2.toLowerCase();

    if (pattern1 === pattern2)
        return 0;

    return pattern1 > pattern2 ? 1 : -1;
}
1044456
@Override
    protected List<Resource> prepareTreeItems(ResourceHandle resource, List<Resource> items) {
        if (!nodesConfig.getOrderableNodesFilter().accept(resource)) {
            Collections.sort(items, new Comparator<Resource>() {
                @Override
                public int compare(Resource r1, Resource r2) {
                    return getSortName(r1).compareTo(getSortName(r2));
                }
            });
        }
        return items;
    }
1298188
public static int compare( String s1, String s2)
	{
		if (s1 == null && s2 == null)
		{
			return 0;
		}
		else if (s1 == null && s2 != null)
		{
			return -1;
		}
		else if (s1 != null && s2 == null)
		{
			return 1;
		}
		else
		{
			return s1.compareTo(s2);
		}
	}
854987
public static <E> int compare(final Comparable<E> obj1, final E obj2) {
        if (obj1 == obj2) {
            return 0;
        }
        if (obj1 == null) {
            return -1;
        }
        if (obj2 == null) {
            return 1;
        }

        return obj1.compareTo(obj2);
    }
497860
public int compareTo(NameValuePair<T> other) {
        String otherName = other.mName;

        if (mName == null) {
            return otherName == null ? 0 : 1;
        }

        if (otherName == null) {
            return -1;
        }

        return mName.compareToIgnoreCase(otherName);
    }
811829
public int compare(T o1, T o2) {
	if(o1 == o2)   return 0;
	String str1 = (o1 == null) ? "null" : o1.toString(); 
	String str2 = (o2 == null) ? "null" : o2.toString();
	return str1.compareTo(str2);
    }
1078397
public static <T extends Comparable<T>> int compare(T o1, T o2) {
		if(o1 == null) {
			return o2 == null ? 0 : 1;
		} else if(o2 == null) {
			return -1;
		} else {
			return o1.compareTo(o2);
		}
	}