int (final DebuggerTreeNode node1, final DebuggerTreeNode node2) { final String name1 = node1.getDescriptor().getName(); final String name2 = node2.getDescriptor().getName(); final boolean invalid1 = (name1 == null || (!name1.isEmpty() && Character.isDigit(name1.charAt(0)))); final boolean invalid2 = (name2 == null || (!name2.isEmpty() && Character.isDigit(name2.charAt(0)))); if (invalid1) { return invalid2 ? 0 : 1; } else if (invalid2) { return -1; } if ("this".equals(name1) || "static".equals(name1)) { return -1; } if ("this".equals(name2) || "static".equals(name2)) { return 1; } return name1.compareToIgnoreCase(name2); }