int (Object o1, Object o2) { int w1 = getWeight(o1); int w2 = getWeight(o2); if (w1 == 0) return w2 == 0 ? 0 : -1; if (w2 == 0) return 1; if (w1 != w2) return -w1 + w2; String s1 = NavBarPresentation.calcPresentableText(o1, false); String s2 = NavBarPresentation.calcPresentableText(o2, false); return StringUtil.naturalCompare(s1, s2); }