+ public static final Comparator<String> LINK_COMPARATOR = new Comparator<String>()
+ {
+ @Override
+ public int compare(String link1, String link2)
+ {
+ if (link1 == null || link2 == null)
+ {
+ return 0; // for failsafe only
+ }
+ if (link1.contains(SEQUENCEID_PLACEHOLDER)
+ && link2.contains(ACCESSION_PLACEHOLDER))
+ {
+ return -1;
+ }
+ if (link2.contains(SEQUENCEID_PLACEHOLDER)
+ && link1.contains(ACCESSION_PLACEHOLDER))
+ {
+ return 1;
+ }
+ return String.CASE_INSENSITIVE_ORDER.compare(link1, link2);
+ }
+ };