int (UsageNode c1, UsageNode c2) { if (c1 instanceof StringNode || c2 instanceof StringNode) { if (c1 instanceof StringNode && c2 instanceof StringNode) { return Comparing.compare(c1.toString(), c2.toString()); } return c1 instanceof StringNode ? 1 : -1; } Usage o1 = c1.getUsage(); Usage o2 = c2.getUsage(); int weight1 = o1 == myTable.USAGES_FILTERED_OUT_SEPARATOR ? 3 : o1 == myTable.USAGES_OUTSIDE_SCOPE_SEPARATOR ? 2 : o1 == myTable.MORE_USAGES_SEPARATOR ? 1 : 0; int weight2 = o2 == myTable.USAGES_FILTERED_OUT_SEPARATOR ? 3 : o2 == myTable.USAGES_OUTSIDE_SCOPE_SEPARATOR ? 2 : o2 == myTable.MORE_USAGES_SEPARATOR ? 1 : 0; if (weight1 != weight2) return weight1 - weight2; return UsageViewImpl.USAGE_COMPARATOR_BY_FILE_AND_OFFSET.compare(o1, o2); }