package com.rehivetech.beeeon;

import android.text.TextUtils;

import java.util.Comparator;

public class IdentifierComparator implements Comparator<IIdentifier> {

	@Override
	public int compare(IIdentifier lhs, IIdentifier rhs) {
		return compareNumericIds(lhs, rhs);
	}

	public static int compareNumericIds(IIdentifier lhs, IIdentifier rhs) {
		String lhsId = lhs.getId();
		String rhsId = rhs.getId();

		if (TextUtils.isDigitsOnly(lhsId) && TextUtils.isDigitsOnly(rhsId)) {
			// Numeric comparison
			return Long.valueOf(lhsId).compareTo(Long.valueOf(rhsId));
		} else {
			// String comparison
			return lhsId.compareTo(rhsId);
		}
	}

}

@@ -57,16 +57,45 @@
 Utils;%0A%0A
+import java.math.BigInteger;%0A
 import j
@@ -538,28 +538,30 @@
 %09return 
-Long.valueOf
+new BigInteger
 (lhsId).
@@ -574,20 +574,22 @@
 eTo(
-Long.valueOf
+new BigInteger
 (rhs

Fix 64bit EUID conversion from String and comparing in Comparator