return (element2 == null) ? 0 : -1;
} else if(element2 == null) {
return 1;
} else {
if(element1 instanceof String) {
element1 = new Utf8((String) element1);
}
if(element2 instanceof String) {
element2 = new Utf8((String) element2);
}
if(element1 instanceof Comparable) {
return ((Comparable) element1).compareTo(element2);
} else if(element2 instanceof Comparable) {
return -((Comparable) element2).compareTo(element1);