int (final TreeNode o1, final TreeNode o2) { if (o1 instanceof BreakpointItemNode && o2 instanceof BreakpointItemNode) { BreakpointItem b1 = ((BreakpointItemNode)o1).getBreakpointItem(); BreakpointItem b2 = ((BreakpointItemNode)o2).getBreakpointItem(); boolean default1 = b1.isDefaultBreakpoint(); boolean default2 = b2.isDefaultBreakpoint(); if (default1 && !default2) return -1; if (!default1 && default2) return 1; return b1.compareTo(b2); } if (o1 instanceof BreakpointsGroupNode group1 && o2 instanceof BreakpointsGroupNode group2) { if (group1.getLevel() != group2.getLevel()) { return group1.getLevel() - group2.getLevel(); } return group1.getGroup().compareTo(group2.getGroup()); } return o1 instanceof BreakpointsGroupNode ? -1 : 1; }